Boats now rotate correctly in position rather than about the origin
#story[1261]
This commit is contained in:
@@ -181,6 +181,14 @@ public class RaceController extends Controller {
|
||||
view3D.setItems(subjects);
|
||||
canvasBase.getChildren().add(0, view3D);
|
||||
|
||||
/*for(Mark mark: race.getVisualiserRaceState().getMarks()) {
|
||||
Subject3D subject = new Subject3D(new Sphere(2));
|
||||
subject.setX(mark.getPosition().getLongitude() * 1000);
|
||||
subject.setZ(mark.getPosition().getLatitude() * 1000);
|
||||
|
||||
subjects.add(subject);
|
||||
}*/
|
||||
|
||||
URL asset = HostController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
|
||||
|
||||
StlMeshImporter importer = new StlMeshImporter();
|
||||
@@ -190,7 +198,7 @@ public class RaceController extends Controller {
|
||||
subjects.add(subject);
|
||||
|
||||
view3D.setPivot(subject);
|
||||
view3D.setDistance(50);
|
||||
view3D.setDistance(500);
|
||||
view3D.setYaw(45);
|
||||
view3D.setPitch(20);
|
||||
|
||||
@@ -200,6 +208,8 @@ public class RaceController extends Controller {
|
||||
@Override
|
||||
public void handle(long now) {
|
||||
subject.setHeading(boat.getBearing().degrees());
|
||||
subject.setX(boat.getPosition().getLongitude());
|
||||
subject.setZ(boat.getPosition().getLatitude());
|
||||
}
|
||||
};
|
||||
rotate.start();
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Subject3D {
|
||||
this.position = new Translate();
|
||||
this.heading = new Rotate(0, Rotate.Y_AXIS);
|
||||
|
||||
this.mesh.getTransforms().addAll(heading, new Rotate(-90, Rotate.X_AXIS), position);
|
||||
this.mesh.getTransforms().addAll(position, heading, new Rotate(-90, Rotate.X_AXIS));
|
||||
}
|
||||
|
||||
public Shape3D getMesh() {
|
||||
|
||||
Reference in New Issue
Block a user