Scaled down marks and boats to make 3rd person view more realistic
- Added boat and mark annotations to support selection at large camera distance - Reduced collision radius to 15 m - Fixed event startup and XML files as race was crashing on start #story[1296]
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package visualiser.layout;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.Box;
|
||||
import javafx.scene.transform.Rotate;
|
||||
|
||||
/**
|
||||
* Created by cbt24 on 9/09/17.
|
||||
*/
|
||||
public class BoatArrow extends Subject3D {
|
||||
public BoatArrow(double length) {
|
||||
super(new Box(length/3, 0, length));
|
||||
this.getMesh().getTransforms().add(new Rotate(-90, Rotate.X_AXIS));
|
||||
this.getMesh().setMaterial(new PhongMaterial(new Color(1, 0, 0, 0.5)));
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package visualiser.layout;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.Cylinder;
|
||||
import javafx.scene.transform.Rotate;
|
||||
|
||||
/**
|
||||
* Created by cbt24 on 9/09/17.
|
||||
@@ -10,6 +11,7 @@ import javafx.scene.shape.Cylinder;
|
||||
public class MarkRadius extends Subject3D {
|
||||
public MarkRadius(double radius) {
|
||||
super(new Cylinder(radius, 0));
|
||||
this.getMesh().getTransforms().add(new Rotate(-90, Rotate.X_AXIS));
|
||||
this.getMesh().setMaterial(new PhongMaterial(new Color(1, 0, 0, 0.5)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package visualiser.layout;
|
||||
|
||||
import javafx.scene.shape.Shape3D;
|
||||
import javafx.scene.transform.Rotate;
|
||||
import javafx.scene.transform.Scale;
|
||||
import javafx.scene.transform.Translate;
|
||||
|
||||
/**
|
||||
@@ -23,16 +24,19 @@ public class Subject3D {
|
||||
*/
|
||||
private Rotate heading;
|
||||
|
||||
private Scale scale;
|
||||
|
||||
/**
|
||||
* Constructor for view subject wrapper
|
||||
* @param mesh to be rendered
|
||||
*/
|
||||
public Subject3D(Shape3D mesh) {
|
||||
this.mesh = mesh;
|
||||
this.scale = new Scale();
|
||||
this.position = new Translate();
|
||||
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.mesh.getTransforms().addAll(position, scale, heading, new Rotate(90, Rotate.X_AXIS), new Rotate(180, Rotate.Y_AXIS));
|
||||
}
|
||||
|
||||
public Shape3D getMesh() {
|
||||
@@ -47,6 +51,12 @@ public class Subject3D {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setScale(double scale) {
|
||||
this.scale.setX(scale);
|
||||
this.scale.setY(scale);
|
||||
this.scale.setZ(scale);
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
position.setX(x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user