Partially working mounts on lerp doors

This commit is contained in:
2025-10-22 11:03:46 +01:00
parent f8073381ee
commit af245fb5bf
10 changed files with 78 additions and 150 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
{-# OPTIONS -Wno-incomplete-uni-patterns #-}
module Dodge.WdP2f (doWdP2f) where
import Dodge.ShiftPoint
import Control.Lens
import Dodge.Data.World
import Geometry.Data
import Geometry.Vector
-- # OPTIONS -Wno-incomplete-uni-patterns #-}
doWdP2f :: WdP2f -> World -> (Point2, Float)
doWdP2f x = case x of
WdP2f0 -> const (0, 0)
WdP2fDoorPosition drid -> \w ->
let Just (a, b) = w ^? cWorld . lWorld . doors . ix drid . drPos
in (b, argV (a -.- b))
let dr = w ^?! cWorld . lWorld . doors . ix drid
in lerpP2A (dr ^. drZeroPos) (dr ^. drOnePos) (dr ^. drLerp)