Added marks back to the race view
#story[1261]
This commit is contained in:
@@ -181,29 +181,33 @@ public class RaceController extends Controller {
|
|||||||
view3D.setItems(subjects);
|
view3D.setItems(subjects);
|
||||||
canvasBase.getChildren().add(0, view3D);
|
canvasBase.getChildren().add(0, view3D);
|
||||||
|
|
||||||
/*for(Mark mark: race.getVisualiserRaceState().getMarks()) {
|
for(Mark mark: race.getVisualiserRaceState().getMarks()) {
|
||||||
Subject3D subject = new Subject3D(new Sphere(2));
|
Subject3D subject = new Subject3D(new Sphere(2));
|
||||||
subject.setX(mark.getPosition().getLongitude() * 1000);
|
subject.setX(mark.getPosition().getLongitude());
|
||||||
subject.setZ(mark.getPosition().getLatitude() * 1000);
|
subject.setZ(mark.getPosition().getLatitude());
|
||||||
|
|
||||||
|
System.out.println(subject.getPosition().toString());
|
||||||
subjects.add(subject);
|
subjects.add(subject);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
VisualiserBoat boat = race.getVisualiserRaceState().getBoat(race.getVisualiserRaceState().getPlayerBoatID());
|
||||||
|
|
||||||
URL asset = HostController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
|
URL asset = HostController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
|
||||||
|
|
||||||
StlMeshImporter importer = new StlMeshImporter();
|
StlMeshImporter importer = new StlMeshImporter();
|
||||||
importer.read(asset);
|
importer.read(asset);
|
||||||
Subject3D subject = new Subject3D(new MeshView(importer.getImport()));
|
Subject3D subject = new Subject3D(new MeshView(importer.getImport()));
|
||||||
|
subject.setX(boat.getPosition().getLongitude());
|
||||||
|
subject.setZ(boat.getPosition().getLatitude());
|
||||||
|
|
||||||
|
System.out.println(subject.getPosition().toString());
|
||||||
subjects.add(subject);
|
subjects.add(subject);
|
||||||
|
|
||||||
view3D.setPivot(subject);
|
view3D.setPivot(subject);
|
||||||
view3D.setDistance(500);
|
view3D.setDistance(500);
|
||||||
view3D.setYaw(45);
|
view3D.setYaw(0);
|
||||||
view3D.setPitch(20);
|
view3D.setPitch(20);
|
||||||
|
|
||||||
try {
|
|
||||||
VisualiserBoat boat = race.getVisualiserRaceState().getBoat(race.getVisualiserRaceState().getPlayerBoatID());
|
|
||||||
AnimationTimer rotate = new AnimationTimer() {
|
AnimationTimer rotate = new AnimationTimer() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(long now) {
|
public void handle(long now) {
|
||||||
|
|||||||
@@ -38,16 +38,8 @@ public class Subject3D {
|
|||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getX() {
|
public Translate getPosition() {
|
||||||
return position.getTx();
|
return this.position;
|
||||||
}
|
|
||||||
|
|
||||||
public double getY() {
|
|
||||||
return position.getTy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getZ() {
|
|
||||||
return position.getTz();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setX(double x) {
|
public void setX(double x) {
|
||||||
|
|||||||
@@ -117,9 +117,7 @@ public class View3D extends Pane {
|
|||||||
* @param pivot centred object
|
* @param pivot centred object
|
||||||
*/
|
*/
|
||||||
public void setPivot(Subject3D pivot) {
|
public void setPivot(Subject3D pivot) {
|
||||||
this.pivot.setX(pivot.getX());
|
this.pivot = pivot.getPosition();
|
||||||
this.pivot.setY(pivot.getY());
|
|
||||||
this.pivot.setZ(pivot.getZ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user