diff options
-rw-r--r-- | src/direction.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/direction.h b/src/direction.h index 595693f..432f7a9 100644 --- a/src/direction.h +++ b/src/direction.h | |||
@@ -66,7 +66,7 @@ inline Direction oppositeDirection(Direction value) { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | inline Direction directionFacingPoint(vec2i point) { | 68 | inline Direction directionFacingPoint(vec2i point) { |
69 | double theta = atan2(point.y(), point.x()); | 69 | double theta = atan2(-point.y(), point.x()); |
70 | theta /= M_PI; | 70 | theta /= M_PI; |
71 | 71 | ||
72 | if (theta < -7.0/8.0) { | 72 | if (theta < -7.0/8.0) { |
@@ -91,7 +91,7 @@ inline Direction directionFacingPoint(vec2i point) { | |||
91 | } | 91 | } |
92 | 92 | ||
93 | inline Direction cardinalDirectionFacingPoint(vec2i point) { | 93 | inline Direction cardinalDirectionFacingPoint(vec2i point) { |
94 | double theta = atan2(point.y(), point.x()); | 94 | double theta = atan2(-point.y(), point.x()); |
95 | theta /= M_PI; | 95 | theta /= M_PI; |
96 | 96 | ||
97 | if (theta < -3.0/4.0) { | 97 | if (theta < -3.0/4.0) { |