From cfbb27513d3f3c14e5beda37ff836c6c54566e37 Mon Sep 17 00:00:00 2001 From: Connor Taylor-Brown Date: Mon, 27 Mar 2017 20:59:51 +1300 Subject: [PATCH] Fixed wake scale for realistic speeds. #story[21] --- src/main/java/seng302/Constants.java | 2 ++ src/main/java/seng302/Model/BoatInRace.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/seng302/Constants.java b/src/main/java/seng302/Constants.java index fc198910..1c3e43a3 100644 --- a/src/main/java/seng302/Constants.java +++ b/src/main/java/seng302/Constants.java @@ -21,6 +21,8 @@ public class Constants { public static final GPSCoordinate finishLineMarker1 = new GPSCoordinate(32.317379, -64.839291); public static final GPSCoordinate finishLineMarker2 = new GPSCoordinate(32.317257, -64.836260); + public static final double wakeScale = 10; + public static final BoatInRace[] OFFICIAL_AC35_COMPETITORS = new BoatInRace[] {new BoatInRace("Oracle Team USA", 30.0, Color.BLUEVIOLET, "USA"), new BoatInRace("Land Rover BAR", 23.0, Color.BLACK, "BAR"), diff --git a/src/main/java/seng302/Model/BoatInRace.java b/src/main/java/seng302/Model/BoatInRace.java index d2776845..01b410ae 100644 --- a/src/main/java/seng302/Model/BoatInRace.java +++ b/src/main/java/seng302/Model/BoatInRace.java @@ -4,6 +4,7 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.scene.paint.Color; import org.geotools.referencing.GeodeticCalculator; +import seng302.Constants; import seng302.GPSCoordinate; import java.awt.geom.Point2D; @@ -76,7 +77,7 @@ public class BoatInRace extends Boat { public GPSCoordinate getWake() { double reverseHeading = calculateHeading() - 180; - double distance = getVelocity(); + double distance = Constants.wakeScale * getVelocity(); GeodeticCalculator calc = new GeodeticCalculator(); calc.setStartingGeographicPoint(