Hack wall depth, objects don't appear on top of walls (nor beneath windows)

This commit is contained in:
jgk
2021-03-21 23:51:56 +01:00
parent 863f2d3d7a
commit 5a5ca6f208
4 changed files with 32 additions and 101 deletions
+2 -14
View File
@@ -28,13 +28,6 @@ mkAutoDoor pl pr xs = addSound $ zipWith3 (autoDoorPane [pl,pr])
xs
(lDoorClosed ++ rDoorClosed)
(map shiftL lDoorClosed ++ map shiftR rDoorClosed)
-- [ [plld,pld]
-- , [pld,plu]
-- , [plu,pllu]
-- , [prru,pru]
-- , [pru,prd]
-- , [prd,prrd]
-- ]
where lDoorClosed = [ [pld,hwd]
, [hwd,hwu]
, [hwu,plu]
@@ -45,7 +38,6 @@ mkAutoDoor pl pr xs = addSound $ zipWith3 (autoDoorPane [pl,pr])
]
norm = 10 *.* errorNormalizeV 49 ( vNormal (pr -.- pl))
hw = 0.5 *.* (pl +.+ pr)
--parallel = 15 *.* normalizeV (pl -.- pr)
parallel = 0.5 *.* (pl -.- pr)
plu = pl +.+ norm
pld = pl -.- norm
@@ -56,14 +48,10 @@ mkAutoDoor pl pr xs = addSound $ zipWith3 (autoDoorPane [pl,pr])
shiftL = map $ (+.+ parallel) . (-.- normalizeV parallel)
shiftR = map $ (-.- parallel) . (+.+ normalizeV parallel)
pllu = plu +.+ parallel
plld = pld +.+ parallel
prru = pru -.- parallel
prrd = prd -.- parallel
addSound (x:xs) = f x : xs
f wl = over doorMech g wl
g dm w | dist wp pld > 1 && dist wp hwd > 1 = soundFrom (WallSound (head xs)) (fromIntegral doorSound) 1 0
$ dm w
g dm w | dist wp pld > 1 && dist wp hwd > 1
= soundFrom (WallSound (head xs)) (fromIntegral doorSound) 1 0 $ dm w
| otherwise = dm w
where wp = (_wlLine $ _walls w IM.! (head xs)) !! 1