|
|
|
|
@ -297,6 +297,22 @@ public class RaceViewController extends Controller {
|
|
|
|
|
|
|
|
|
|
viewSubjects.add(markModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (VisualiserBoat boat: race.getVisualiserRaceState().getBoats()) {
|
|
|
|
|
if (boat.isClientBoat()) {
|
|
|
|
|
BoatHighlight boatHighlight = new BoatHighlight(10, new Color(1, 1, 0, 0.1));
|
|
|
|
|
viewSubjects.add(boatHighlight);
|
|
|
|
|
AnimationTimer highlightTrack = new AnimationTimer() {
|
|
|
|
|
@Override
|
|
|
|
|
public void handle(long now) {
|
|
|
|
|
boatHighlight.setX(gpsConverter.convertGPS(boat.getPosition()).getX());
|
|
|
|
|
boatHighlight.setZ(gpsConverter.convertGPS(boat.getPosition()).getY());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
highlightTrack.start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Position and add each boat to view
|
|
|
|
|
for (VisualiserBoat boat: race.getVisualiserRaceState().getBoats()) {
|
|
|
|
|
MeshView mesh;
|
|
|
|
|
@ -322,21 +338,6 @@ public class RaceViewController extends Controller {
|
|
|
|
|
};
|
|
|
|
|
trackBoat.start();
|
|
|
|
|
|
|
|
|
|
if (boat.isClientBoat()) {
|
|
|
|
|
BoatHighlight boatHighlight = new BoatHighlight(10, new Color(1, 1, 0, 0.1));
|
|
|
|
|
viewSubjects.add(boatHighlight);
|
|
|
|
|
boatModel.getMesh().toFront();
|
|
|
|
|
AnimationTimer highlightTrack = new AnimationTimer() {
|
|
|
|
|
@Override
|
|
|
|
|
public void handle(long now) {
|
|
|
|
|
boatHighlight.setX(boatModel.getPosition().getX());
|
|
|
|
|
boatHighlight.setY(boatModel.getPosition().getY());
|
|
|
|
|
boatHighlight.setZ(boatModel.getPosition().getZ());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
highlightTrack.start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Material markColor = new PhongMaterial(new Color(0.15,0.9,0.2,1));
|
|
|
|
|
CompoundMark nextMark = boat.getCurrentLeg().getEndCompoundMark();
|
|
|
|
|
view3D.getShape(nextMark.getMark1().getSourceID()).getMesh().setMaterial(markColor);
|
|
|
|
|
|