Implement slowed down aim turning

This commit is contained in:
2023-01-08 11:10:42 +00:00
parent 44bb6e7e02
commit 05d081497d
11 changed files with 46 additions and 26 deletions
+3 -2
View File
@@ -168,8 +168,9 @@ nRaysRad n x = take n $ iterate (rotateV (2*pi/fromIntegral n)) (V2 x 0)
-- smallest change in rotation between them.
-- This appears to sometimes fail if the angles are not normalized.
isLeftOfA :: Float -> Float -> Bool
isLeftOfA angle1 angle2 = (angle1 - angle2 < pi && angle1 > angle2)
|| (angle2 - angle1 > pi && angle2 > angle1)
--isLeftOfA angle1 angle2 = (angle1 - angle2 < pi && angle1 > angle2)
-- || (angle2 - angle1 > pi && angle2 > angle1)
isLeftOfA angle1 angle2 = normalizeAngle (angle1 - angle2) < pi
-- | Test whether a vector is to the left of another, according to the smallest
-- change of rotation between them.
isLeftOf :: Point2 -> Point2 -> Bool