Move towards unifying door movement

This commit is contained in:
2025-10-21 23:13:36 +01:00
parent 2f3a00a971
commit 39677c3a02
9 changed files with 143 additions and 79 deletions
+8 -6
View File
@@ -1,12 +1,14 @@
{-# LANGUAGE BangPatterns #-}
module Dodge.ShiftPoint where
import Geometry
shiftPointBy :: (Point2,Float) -> Point2 -> Point2
shiftPointBy (pos,rot) !p = pos +.+ rotateV rot p
shiftPointBy :: Point2A -> Point2 -> Point2
shiftPointBy (pos, rot) !p = pos +.+ rotateV rot p
invShiftPointBy :: (Point2,Float) -> Point2 -> Point2
invShiftPointBy (p1,r) p2 = rotateV (-r) $ p2 -.- p1
invShiftPointBy :: (Point2, Float) -> Point2 -> Point2
invShiftPointBy (p1, r) p2 = rotateV (- r) $ p2 -.- p1
shiftPoint3By :: (Point2,Float) -> Point3 -> Point3
shiftPoint3By (pos,rot) (V3 x y z) = addZ z $ pos +.+ rotateV rot (V2 x y)
shiftPoint3By :: (Point2, Float) -> Point3 -> Point3
shiftPoint3By (pos, rot) (V3 x y z) = addZ z $ pos +.+ rotateV rot (V2 x y)