Tried to get multiple boats working but.... it's not #story[1196]
This commit is contained in:
@@ -93,7 +93,7 @@ public class HostController extends Controller {
|
||||
*/
|
||||
public void hostGamePressed() {
|
||||
try {
|
||||
this.game = new Event(false);
|
||||
this.game = new Event(true);
|
||||
connectSocket("localhost", 4942);
|
||||
} catch (EventConstructionException e) {
|
||||
Logger.getGlobal().log(Level.SEVERE, "Could not create Event.", e);
|
||||
|
||||
@@ -191,6 +191,10 @@ public class RaceController extends Controller {
|
||||
StlMeshImporter importerMark = new StlMeshImporter();
|
||||
importerMark.read(markerAsset);
|
||||
|
||||
URL alternateBoatAsset = HostController.class.getClassLoader().getResource("assets/V1.3 BurgerBoat.stl");
|
||||
StlMeshImporter importerBurgerBoat = new StlMeshImporter();
|
||||
importerBurgerBoat.read(alternateBoatAsset);
|
||||
|
||||
view3D = new View3D();
|
||||
view3D.setDistance(1050);
|
||||
view3D.setYaw(0);
|
||||
@@ -222,10 +226,14 @@ public class RaceController extends Controller {
|
||||
}
|
||||
|
||||
for(VisualiserBoat boat: race.getVisualiserRaceState().getBoats()) {
|
||||
MeshView mesh = new MeshView(importer.getImport());
|
||||
MeshView mesh = null;
|
||||
if(boat.getSourceID() == race.getVisualiserRaceState().getPlayerBoatID()) {
|
||||
mesh = new MeshView(importer.getImport());
|
||||
} else {
|
||||
mesh = new MeshView(importerBurgerBoat.getImport());
|
||||
}
|
||||
Subject3D subject = new Subject3D(mesh);
|
||||
subjects.add(subject);
|
||||
|
||||
AnimationTimer trackBoat = new AnimationTimer() {
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
|
||||
@@ -33,9 +33,9 @@ public class Subject3D {
|
||||
this.heading = new Rotate(0, Rotate.Y_AXIS);
|
||||
|
||||
this.mesh.getTransforms().addAll(position, heading, new Rotate(90, Rotate.X_AXIS), new Rotate(180, Rotate.Y_AXIS));
|
||||
this.position.xProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat x: " + newValue)));
|
||||
this.position.yProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat y: " + newValue)));
|
||||
this.position.zProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat z: " + newValue)));
|
||||
// this.position.xProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat x: " + newValue)));
|
||||
// this.position.yProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat y: " + newValue)));
|
||||
// this.position.zProperty().addListener(((observable, oldValue, newValue) -> System.out.println("Boat z: " + newValue)));
|
||||
}
|
||||
|
||||
public Shape3D getMesh() {
|
||||
|
||||
Reference in New Issue
Block a user