Linking up course stream with visualiser. Boats moving, and course drawing. Boats however are not moving as intended. Needs to be fixed/looked into.

#story[820] #pair[kre39,cir27]
This commit is contained in:
Kusal Ekanayake
2017-04-26 18:45:58 +12:00
parent 749c6b7fef
commit c776d22941
9 changed files with 222 additions and 85 deletions
@@ -117,6 +117,15 @@ public class BoatGroup extends Group{
moveBy(dx, dy, rotation);
}
public void setDestination (double newXValue, double newYValue, double rotation) {
this.pixelVelocityX = (newXValue - super.getLayoutX()) / expectedUpdateInterval;
this.pixelVelocityY = (newYValue - super.getLayoutY()) / expectedUpdateInterval;
//this.destinationX = newXValue;
//this.destinationY = newYValue;
this.rotationalGoal = rotation;
this.rotationalVelocity = (rotationalGoal - currentRotation) / expectedUpdateInterval;
}
public void setDestination (double newXValue, double newYValue) {
this.pixelVelocityX = (newXValue - super.getLayoutX()) / expectedUpdateInterval;
this.pixelVelocityY = (newYValue - super.getLayoutY()) / expectedUpdateInterval;
@@ -174,4 +183,8 @@ public class BoatGroup extends Group{
super.getChildren().get(2).setVisible(false);
super.getChildren().get(3).setVisible(false);
}
public Boat getBoat() {
return boat;
}
}