Merge branch 'wind_arrow_direction_5' into 'master'

Wind arrow direction 5

This should fix the wind arrow direction.

The polars were actually backwards so wind was being simulated with: into wind = faster, away from wind = slower.

#### A.C:
- Downwind means the boat's bearing is aligned with the wind arrow.
- Upwind means the boat's bearing is facing directly into the wind arrow.
- Pressing the upwind key should turn the boat in the upwind direction.
- Pressing the downwind key should turn the boat in the downwind direction.
- Facing upwind should result in a boat speed of roughly 0kn.
- Facing downwind should result in non-zero boat speed (roughly 14kn with 12kn wind).


Fixes #51 

See merge request !45
This commit is contained in:
David Wu
2017-09-14 14:45:51 +12:00
2 changed files with 2 additions and 2 deletions
@@ -32,7 +32,7 @@ public class NewPolars {
public static void addPolars(double trueWindSpeed, Bearing trueWindAngle, double boatSpeed){ public static void addPolars(double trueWindSpeed, Bearing trueWindAngle, double boatSpeed){
double tws = trueWindSpeed; double tws = trueWindSpeed;
double bs = boatSpeed; double bs = boatSpeed;
double twa = trueWindAngle.degrees(); double twa = trueWindAngle.degrees() + 180;
if (!polars.containsKey(tws)){ if (!polars.containsKey(tws)){
polars.put(tws, new TreeMap<>()); polars.put(tws, new TreeMap<>());
} }
@@ -321,7 +321,7 @@ public class InGameLobbyController extends Controller {
* @param interval Countdown interval to check * @param interval Countdown interval to check
*/ */
private void countdownText(long interval){ private void countdownText(long interval){
countdownTenPane.setVisible(false);
//Do nothing if 5 seconds or less to go //Do nothing if 5 seconds or less to go
if (interval <=5000){ if (interval <=5000){
countdownTenPane.setVisible(false); countdownTenPane.setVisible(false);