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
+3 -3
View File
@@ -56,7 +56,7 @@ doorBetween eo wl cond soff pa pb speed g = case divideLine 40 pa pb of
adoor =
defaultDoor
& drTrigger .~ cond
& drSpeed .~ speed
& drUpdate . drLerpSpeed .~ speed
divideDoorPane ::
Maybe Int ->
@@ -74,7 +74,7 @@ divideDoorPane mid wl cond soff speed ppairs g = case ppairs of
where
adoor (x, y) = PutSlideDr thedoor wl mempty soff x y
thedoor =
defaultDoor & drSpeed .~ speed & drTrigger .~ cond
defaultDoor & drUpdate . drLerpSpeed .~ speed & drTrigger .~ cond
& drPushedBy .~ maybe PushesItself PushedBy mid
putAutoDoor :: Point2 -> Point2 -> Placement
@@ -117,7 +117,7 @@ switchDoor btpos btrot dra drb col = pContID
thedoor =
defaultDoor
& drTrigger .~ WdBlBtOn btid
& drSpeed .~ 2
& drUpdate . drLerpSpeed .~ 2
drc = 0.5 *.* (dra +.+ drb)
--cond btid w' = _btState (_buttons w' IM.! btid) == BtOn
+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