Fix minigun

This commit is contained in:
2022-07-18 11:20:29 +01:00
parent ce36aa8295
commit 13f2255ba7
5 changed files with 41 additions and 79 deletions
+3 -3
View File
@@ -38,6 +38,9 @@ alongSegBy :: Float -> Point2 -> Point2 -> Point2
alongSegBy !x !a !b = a +.+ y *.* normalizeV (b -.- a)
where
y = min x $ dist a b
tweenPoints :: Float -> Point2 -> Point2 -> Point2
tweenPoints = alongSegBy
-- | Debug version of 'pointInPolygon'.
errorPointInPolygon :: Int -> Point2 -> [Point2] -> Bool
errorPointInPolygon !i !p xs
@@ -115,9 +118,6 @@ difference x y
reflectIn :: Point2 -> Point2 -> Point2
reflectIn line vec = rotateV (2 * angleBetween line vec) vec
reflectIn' :: Point2 -> Point2 -> Point2
reflectIn' line vec = rotateV (2 * angleBetween vec line) vec
-- | Find angle between two points.
-- Not normalised, ranges from -2*pi to 2*pi.
angleBetween :: Point2 -> Point2 -> Float