Recovered stable rotation of the player's boat

- Uses AnimationTimer rather than listeners
- Reduced pre-start time to speed up testing

#story[1261]
This commit is contained in:
cbt24
2017-09-05 15:19:04 +12:00
parent c74cc26bf1
commit 3ecf203cba
4 changed files with 45 additions and 35 deletions
@@ -39,34 +39,34 @@ public class Subject3D {
}
public double getX() {
return this.position.getX();
return position.getTx();
}
public double getY() {
return this.position.getY();
return position.getTy();
}
public double getZ() {
return this.position.getZ();
return position.getTz();
}
public void setX(double x) {
this.position.setX(x);
position.setX(x);
}
public void setY(double y) {
this.position.setY(y);
position.setY(y);
}
public void setZ(double z) {
this.position.setZ(z);
position.setZ(z);
}
public double getHeading() {
return this.heading.getAngle();
return heading.getAngle();
}
public void setHeading(double angle) {
this.heading.setAngle(angle);
heading.setAngle(angle);
}
}
@@ -50,6 +50,8 @@ public class View3D extends Pane {
*/
private Rotate pitch;
private PerspectiveCamera camera;
/**
* Default constructor for View3D. Sets up Scene and PerspectiveCamera.
*/
@@ -86,6 +88,7 @@ public class View3D extends Pane {
pitch = new Rotate(0, Rotate.X_AXIS);
camera.getTransforms().addAll(pivot, yaw, pitch, distance);
this.camera = camera;
return camera;
}
@@ -142,4 +145,8 @@ public class View3D extends Pane {
public void setPitch(double pitch) {
this.pitch.setAngle(-pitch);
}
public PerspectiveCamera getCamera() {
return camera;
}
}