mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed a merge issue.
#story[923] #bug #refactor
This commit is contained in:
@@ -62,8 +62,8 @@ public class App extends Application {
|
||||
}
|
||||
//Change the StreamReceiver in this else block to change the default data source.
|
||||
else{
|
||||
// sr = new StreamReceiver("localhost", 4949, "RaceStream");
|
||||
sr = new StreamReceiver("livedata.americascup.com", 4941, "RaceStream");
|
||||
sr = new StreamReceiver("localhost", 4949, "RaceStream");
|
||||
// sr = new StreamReceiver("livedata.americascup.com", 4941, "RaceStream");
|
||||
}
|
||||
|
||||
sr.start();
|
||||
|
||||
@@ -222,8 +222,6 @@ public class BoatGroup extends RaceObject {
|
||||
* on.
|
||||
*/
|
||||
public void updatePosition(long timeInterval) {
|
||||
//Calculate the movement of the boat.
|
||||
if (isMaximized) {
|
||||
double dx = pixelVelocityX * timeInterval;
|
||||
double dy = pixelVelocityY * timeInterval;
|
||||
double rotation = rotationalVelocity * timeInterval;
|
||||
@@ -249,7 +247,6 @@ public class BoatGroup extends RaceObject {
|
||||
}
|
||||
wake.updatePosition(timeInterval);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the destination of the boat and the headng it should have once it reaches
|
||||
@@ -265,28 +262,18 @@ public class BoatGroup extends RaceObject {
|
||||
if (setToInitialLocation) {
|
||||
destinationSet = true;
|
||||
boat.setVelocity(groundSpeed);
|
||||
if (currentRotation < 0) {
|
||||
currentRotation = 360 - currentRotation;
|
||||
}
|
||||
double dx = newXValue - boatPoly.getLayoutX();
|
||||
double dy = newYValue - boatPoly.getLayoutY();
|
||||
//Check movement is reasonable. Assumes a 1000 * 1000 canvas
|
||||
// if (Math.abs(dx) > 50 || Math.abs(dy) > 50) {
|
||||
// dx = 0;
|
||||
// dy = 0;
|
||||
// moveTo(newXValue, newYValue);
|
||||
// }
|
||||
|
||||
|
||||
pixelVelocityX = dx / expectedUpdateInterval;
|
||||
pixelVelocityY = dy / expectedUpdateInterval;
|
||||
rotationalGoal = rotation;
|
||||
calculateRotationalVelocity();
|
||||
|
||||
if (Math.abs(rotationalVelocity) > 0.075) {
|
||||
System.out.println("rotationalVelocity = " + rotationalVelocity);
|
||||
rotationalVelocity = 0;
|
||||
wakeGenerationDelay--;
|
||||
} else {
|
||||
wake.setRotationalVelocity(rotationalVelocity, boat.getVelocity());
|
||||
rotateTo(rotationalGoal);
|
||||
wake.rotate(rotationalGoal);
|
||||
}
|
||||
@@ -312,27 +299,6 @@ public class BoatGroup extends RaceObject {
|
||||
}
|
||||
}
|
||||
//If minimized generate lines every 5 calls to set destination.
|
||||
if (!isMaximized) {
|
||||
setToInitialLocation = false;
|
||||
wakeGenerationDelay = 2;
|
||||
if (setCallCount-- == 0) {
|
||||
setCallCount = 5;
|
||||
if (lastPoint != null) {
|
||||
Line l = new Line(
|
||||
lastPoint.getX(),
|
||||
lastPoint.getY(),
|
||||
newXValue,
|
||||
newYValue
|
||||
);
|
||||
l.getStrokeDashArray().setAll(3d, 7d);
|
||||
l.setStroke(boatPoly.getFill());
|
||||
lineStorage.add(l);
|
||||
}
|
||||
if (destinationSet) { //Only begin drawing after the first destination is set
|
||||
lastPoint = new Point2D(newXValue, newYValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setDestination(double newXValue, double newYValue, double groundSpeed,
|
||||
|
||||
Reference in New Issue
Block a user