First implementation of doors that lerp position/float pairs

This commit is contained in:
2025-10-21 23:39:57 +01:00
parent 39677c3a02
commit fdee74ff0c
2 changed files with 15 additions and 8 deletions
+8 -1
View File
@@ -4,6 +4,7 @@ module Dodge.Placement.PlaceSpot.TriggerDoor (
updateDoorEdges,
) where
import Linear
import Dodge.Data.GenWorld
import qualified Data.IntSet as IS
import Data.List
@@ -91,11 +92,17 @@ plSlideDoor dr wl eo shiftOffset a b gw =
{ _drID = drid
, _drWallIDs = IS.fromList wlids
, _drStatus = DoorClosed
, _drMech = DoorMechanism
-- , _drMech = DoorMechanism
, _drMech = DoorLerp
, _drPos = (a, b)
, _drOpenPos = (shiftLeft a, shiftLeft b)
, _drClosePos = (a, b)
, _drZeroPos = (a, 0)
, _drOnePos = (shiftLeft a, 0)
, _drLerp = 0
, _drFootPrint = IM.fromList $ zip wlids $ rectanglePairs 9 0 (b-a)
, _drObstacleType = eo
, _drSpeed = 1 / distance a (shiftLeft a)
}
addDoorWalls w' = foldl' (addDoorWall eo drid wl) w' $ zip wlids pairs
pairs = rectanglePairs 9 a b