mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed boat heading calculation method to get a correct direction
#story[480] #pair[hyi25, ptg19]
This commit is contained in:
@@ -113,7 +113,8 @@ public class Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the boats heading
|
* Calculates current boat heading direction.
|
||||||
|
* @return the boats heading as degree. vertical upward is 0 degree, and degree goes up clockwise.
|
||||||
*/
|
*/
|
||||||
public double getBoatHeading() {
|
public double getBoatHeading() {
|
||||||
if (mark2 == null){
|
if (mark2 == null){
|
||||||
@@ -132,7 +133,9 @@ public class Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert back to degrees, and flip 180 degrees
|
// Convert back to degrees, and flip 180 degrees
|
||||||
return (Math.toDegrees(headingRadians) + 180) % 360;
|
// return ((headingRadians) * 180) / Math.PI;
|
||||||
|
return (Math.toDegrees(headingRadians) + 90) % 360;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mark getThisMark() {
|
public Mark getThisMark() {
|
||||||
|
|||||||
Reference in New Issue
Block a user