Mock.Race:
Usages of VMG.bearing now use the getBearing() function, as the member is now private. #story[873]
This commit is contained in:
@@ -315,9 +315,9 @@ public class Race implements Runnable {
|
|||||||
boat.calculateBearingToDestination(), min(bound1, bound2), max(bound1,bound2));
|
boat.calculateBearingToDestination(), min(bound1, bound2), max(bound1,bound2));
|
||||||
|
|
||||||
|
|
||||||
double azimuth = newHeading.bearing;
|
double azimuth = newHeading.getBearing();
|
||||||
if (newHeading.bearing > 180){
|
if (newHeading.getBearing() > 180){
|
||||||
azimuth = newHeading.bearing -360;
|
azimuth = newHeading.getBearing() -360;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!GPSCoordinate.isInsideBoundary(calculatePosition(boat.getCurrentPosition(),
|
// if (!GPSCoordinate.isInsideBoundary(calculatePosition(boat.getCurrentPosition(),
|
||||||
@@ -327,11 +327,11 @@ public class Race implements Runnable {
|
|||||||
// newHeading.bearing = tempHeading;
|
// newHeading.bearing = tempHeading;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
boat.setHeading(newHeading.bearing);
|
boat.setHeading(newHeading.getBearing());
|
||||||
boat.setVelocity(newHeading.speed);
|
boat.setVelocity(newHeading.getSpeed());
|
||||||
|
|
||||||
//calc the distance travelled in a straight line to windward
|
//calc the distance travelled in a straight line to windward
|
||||||
double angleBetweenDestAndHeading = newHeading.bearing - boat.calculateBearingToDestination();
|
double angleBetweenDestAndHeading = newHeading.getBearing() - boat.calculateBearingToDestination();
|
||||||
totalDistanceTravelled = cos(angleBetweenDestAndHeading)*totalDistanceTravelledInTack;
|
totalDistanceTravelled = cos(angleBetweenDestAndHeading)*totalDistanceTravelledInTack;
|
||||||
boat.setDistanceTravelledInLeg(totalDistanceTravelled);
|
boat.setDistanceTravelledInLeg(totalDistanceTravelled);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user