Fix angle when newDistance < 0
This commit is contained in:
parent
df60404ea3
commit
1707751bf3
@ -11,7 +11,7 @@ Polar::Polar() {
|
|||||||
Polar::Polar(float newAngle, float newDistance) {
|
Polar::Polar(float newAngle, float newDistance) {
|
||||||
// distance should always be 0 or greater
|
// distance should always be 0 or greater
|
||||||
if (newDistance < 0) {
|
if (newDistance < 0) {
|
||||||
angle = angle - 180;
|
angle = newAngle - 180;
|
||||||
distance = -newDistance;
|
distance = -newDistance;
|
||||||
} else {
|
} else {
|
||||||
angle = newAngle;
|
angle = newAngle;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user