Improve shadows for static walls

This commit is contained in:
jgk
2021-03-05 13:40:34 +01:00
parent e4c51bc47a
commit 5f8b5881e5
8 changed files with 62 additions and 34 deletions
+6 -3
View File
@@ -33,7 +33,7 @@ import qualified Data.IntMap.Strict as IM
import qualified Data.Set as S
import qualified Data.Map as M
import Data.Graph.Inductive
import Data.Graph.Inductive hiding ((&))
import Data.Graph.Inductive.NodeMap
import Data.Tree
-- }}}
@@ -563,9 +563,12 @@ autoDoorPane trigL n [a,b] [a',b'] = AutoDoor
| otherwise = flip (foldr changeZonedWall') zoneps
$ over walls (IM.adjust closeDoor n) w
mvP !ep !p = mvPointTowardAtSpeed 2 ep p
moveToward :: [Point2] -> Wall -> Wall
moveToward ps w = w & wlLine %~ zipWith mvP ps
openDoor :: Wall -> Wall
openDoor wl = case _wlLine wl of
((!pa):(!pb):_) -> wl {_wlLine = [mvP a' pa, mvP b' pb]}
-- openDoor wl = case _wlLine wl of
-- ((!pa):(!pb):_) -> wl {_wlLine = [mvP a' pa, mvP b' pb]}
openDoor = moveToward [a',b']
closeDoor :: Wall -> Wall
closeDoor wl = case _wlLine wl of
((!pa):(!pb):_) -> wl {_wlLine = [mvP a pa, mvP b pb]}