Got the boat's to track and center correctly.

As well as allowing selecting different boats to track them, doesn't work as intuitively as I would like but will need to sort out a boat selection feature first made specifically for the selection of only one boat.

 #story[1121]
This commit is contained in:
Kusal Ekanayake
2017-08-14 17:27:14 +12:00
parent 4dc6b2af2b
commit fab5f9229f
3 changed files with 33 additions and 13 deletions
@@ -40,7 +40,8 @@ public class BoatObject extends Group {
private double distanceTravelled, lastRotation;
private Point2D lastPoint;
private Paint colour = Color.BLACK;
private Boolean isSelected, destinationSet; //All boats are initialised as selected
private Boolean isSelected = false, destinationSet; //All boats are initialised as selected
private Boolean isBeingTracked = false;
private boolean isPlayer = false;
/**
@@ -287,6 +288,7 @@ public class BoatObject extends Group {
public void setIsSelected(Boolean isSelected) {
this.isSelected = isSelected;
this.isBeingTracked = isSelected;
setLineGroupVisible(isSelected);
setWakeVisible(isSelected);
setLayLinesVisible(isSelected);
@@ -364,6 +366,14 @@ public class BoatObject extends Group {
lastHeading = heading;
}
public Boolean getBeingTracked() {
return isBeingTracked;
}
public Boolean getSelected() {
return isSelected;
}
public void setTrajectory(double heading, double velocity, double scaleFactorX, double scaleFactorY) {
// wake.setRotation(lastHeading - heading, velocity);
// rotateTo(heading);