Highlighting no longer goes over other boats. Player boat is highlighted in lobby. #story[1298]
This commit is contained in:
@@ -15,6 +15,7 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.MeshView;
|
||||
import mock.app.Event;
|
||||
@@ -22,6 +23,7 @@ import network.Messages.Enums.RaceStatusEnum;
|
||||
import network.Messages.Enums.RequestToJoinEnum;
|
||||
import visualiser.app.App;
|
||||
import visualiser.gameController.ControllerClient;
|
||||
import visualiser.layout.BoatHighlight;
|
||||
import visualiser.layout.SeaSurface;
|
||||
import visualiser.layout.Subject3D;
|
||||
import visualiser.layout.View3D;
|
||||
@@ -155,6 +157,14 @@ public class InGameLobbyController extends Controller {
|
||||
playerBoatToSet.setPitch(20);
|
||||
|
||||
|
||||
if (boat.isClientBoat()) {
|
||||
BoatHighlight boatHighlight = new BoatHighlight(10, new Color(1, 1, 0, 0.1));
|
||||
boatHighlight.setX(subject.getPosition().getX());
|
||||
boatHighlight.setY(subject.getPosition().getY());
|
||||
boatHighlight.setZ(subject.getPosition().getZ());
|
||||
subjects.add(boatHighlight);
|
||||
subject.getMesh().toFront();
|
||||
}
|
||||
|
||||
AnimationTimer rotate = new AnimationTimer() {
|
||||
@Override
|
||||
|
||||
@@ -297,8 +297,24 @@ 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()) {
|
||||
for (VisualiserBoat boat: race.getVisualiserRaceState().getBoats()) {
|
||||
MeshView mesh;
|
||||
if(boat.getSourceID() == race.getVisualiserRaceState().getPlayerBoatID()) {
|
||||
mesh = new MeshView(importer.getImport());
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user