Finished playable 3D race with first person camera

- Camera pivot must be manually updated
- GPS coordinates are scaled by an arbitrary amount to make movement visible
- Model has to be flipped 180 degrees to move forward

#story[1261]
This commit is contained in:
Connor Taylor-Brown
2017-09-06 14:36:24 +12:00
parent 19f4d0fc06
commit d89186d8bf
4 changed files with 29 additions and 39 deletions
@@ -34,7 +34,7 @@ public class View3D extends Pane {
*/
private double farClip;
/**
* Position camera pivots around
* Camera origin
*/
private Translate pivot;
/**
@@ -112,14 +112,11 @@ public class View3D extends Pane {
this.farClip = farClip;
}
/**
* Set object to centre on camera
* @param pivot centred object
*/
public void setPivot(Subject3D pivot) {
this.pivot = pivot.getPosition();
public void updatePivot(Translate pivot) {
this.pivot.setX(pivot.getX());
this.pivot.setY(pivot.getY());
this.pivot.setZ(pivot.getZ());
}
/**
* Set distance of camera from pivot
* @param distance in units
@@ -143,8 +140,4 @@ public class View3D extends Pane {
public void setPitch(double pitch) {
this.pitch.setAngle(-pitch);
}
public PerspectiveCamera getCamera() {
return camera;
}
}