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 -1
View File
@@ -7,6 +7,7 @@ module Dodge.Block.Debris (
makeDebrisDirected,
) where
import Dodge.ShiftPoint
import Color
import Data.Foldable
import qualified Data.IntSet as IS
@@ -24,7 +25,8 @@ import Shape
makeDoorDebris :: Door -> World -> World
makeDoorDebris dr w = w & makeDebris mt col p
where
p = uncurry midPoint (_drPos dr)
p2a = lerpP2A (dr ^. drZeroPos) (dr ^. drOnePos) (dr ^. drLerp)
p = centroid . fmap fst $ (dr ^. drFootPrint) & each . each %~ shiftPointBy p2a
(mt, col) = fromMaybe (Stone, greyN 0.5) $ do
wlids <- w ^? cWorld . lWorld . doors . ix (_drID dr) . drWallIDs
(wlid, _) <- IS.minView wlids