Start simplifying/removing Wall records

This commit is contained in:
2025-10-23 18:11:01 +01:00
parent fc7c4d6468
commit 819f0d37ea
18 changed files with 230 additions and 243 deletions
+2 -8
View File
@@ -36,18 +36,14 @@ plDoor col eo cond l p1 p2 gw = (drid, over gwWorld addWalls $ gw & gwWorld . cW
IM.insert drid $
defaultDoor
{ _drID = drid
-- , _drWallIDs = IS.fromList wlids
, _drTrigger = cond
, _drMech = DoorLerp
, _drUpdate = DoorLerp 0.01
, _drZeroPos = p1
, _drOnePos = p2
, _drLerp = 0
, _drFootPrint = IM.fromList . zip wlids $ wlps'
, _drSpeed = 0.01
}
-- nsteps = length pss - 1
wlids = take 4 [IM.newKey $ _walls (_lWorld (_cWorld $ _gwWorld gw)) ..]
--wlps' = uncurry (rectanglePairs 9) $ head pss
wlps' = rectanglePairs 9 0 (V2 l 0)
addWalls w' = foldl' (addDoorWall eo drid $ switchWallCol col) w' $ zip wlids
$ wlps' & each . each %~ shiftPointBy p1
@@ -96,13 +92,11 @@ plSlideDoor dr wl eo shiftOffset a b gw =
IM.insert drid $
dr
{ _drID = drid
-- , _drWallIDs = IS.fromList wlids
, _drMech = DoorLerp
, _drUpdate = DoorLerp $ 1 / distance a (shiftLeft a)
, _drZeroPos = (a, 0)
, _drOnePos = (shiftLeft a, 0)
, _drLerp = 0
, _drFootPrint = IM.fromList $ zip wlids $ rectanglePairs 9 0 (b-a)
, _drSpeed = 1 / distance a (shiftLeft a)
}
addDoorWalls w' = foldl' (addDoorWall eo drid wl) w' $ zip wlids pairs
pairs = rectanglePairs 9 a b