Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+6 -6
View File
@@ -20,9 +20,9 @@ makeDoorDebris dr w = w & makeDebris mt col p
where
p = uncurry midPoint (_drPos dr)
(mt, col) = fromMaybe (Stone, greyN 0.5) $ do
wlids <- w ^? cWorld . doors . ix (_drID dr) . drWallIDs
wlids <- w ^? cWorld . lWorld . doors . ix (_drID dr) . drWallIDs
(wlid, _) <- IS.minView wlids
wl <- w ^? cWorld . walls . ix wlid
wl <- w ^? cWorld . lWorld . walls . ix wlid
return (_wlMaterial wl, _wlColor wl)
makeBlockDebris :: Block -> World -> World
@@ -31,9 +31,9 @@ makeBlockDebris bl w = foldl' (flip $ makeDebris mt col) w ps
dsize = debrisSize mt
ps = gridInPolygon dsize $ shrinkPolyOnEdges dsize $ reverse (_blFootprint bl)
(mt, col) = fromMaybe (Stone, greyN 0.5) $ do
wlids <- w ^? cWorld . blocks . ix (_blID bl) . blWallIDs
wlids <- w ^? cWorld . lWorld . blocks . ix (_blID bl) . blWallIDs
(wlid, _) <- IS.minView wlids
wl <- w ^? cWorld . walls . ix wlid
wl <- w ^? cWorld . lWorld . walls . ix wlid
return (_wlMaterial wl, _wlColor wl)
makeDebrisToHeight :: Float -> Material -> Color -> Point2 -> World -> World
@@ -55,7 +55,7 @@ makeDebrisDirectedHeight ::
World
makeDebrisDirectedHeight mindist maxdist arcrad dir maxh bm col p w =
w
& flip (foldl' (flip $ plNew (cWorld . props) prID)) thedebris
& flip (foldl' (flip $ plNew (cWorld . lWorld . props) prID)) thedebris
& randGen .~ newg
& originsIDsAt [MaterialSound bm i | i <- [0, 1, 2]] (destroyMatS bm) p
where
@@ -88,7 +88,7 @@ makeDebrisDirected ::
World
makeDebrisDirected mindist maxdist arcrad dir bm col p w =
w
& flip (foldl' (flip $ plNew (cWorld . props) prID)) thedebris
& flip (foldl' (flip $ plNew (cWorld . lWorld . props) prID)) thedebris
& randGen .~ newg
& originsIDsAt [MaterialSound bm i | i <- [0, 1, 2]] (destroyMatS bm) p
where