Add indicator light to switch doors

This commit is contained in:
2021-11-16 12:57:13 +00:00
parent a7f2b5f3ea
commit f530952612
9 changed files with 117 additions and 20 deletions
+8 -1
View File
@@ -14,6 +14,7 @@ import Dodge.Bounds
import Dodge.Default.Wall
import Dodge.Room.Link
import Geometry
import Geometry.Vector3D
import Geometry.ConvexPoly
import qualified IntMapHelp as IM
import Tile
@@ -66,6 +67,12 @@ placeRoomWires rm w = IM.foldr ($) w
$ IM.intersectionWith (placeWire rm) (_rmStartWires rm) (_rmEndWires rm)
placeWire :: Room -> RoomWire -> RoomWire -> World -> World
placeWire rm (WallWire p a h) wr = placeWire rm wr (RoomWire p a) .
(foregroundShape %~ (colorSH red (barPP 1.5 (addZ h p') (addZ 80 p')) <>)
)
where
p' = shiftPointBy (_rmShift rm) p
placeWire rm rw1 rw2@WallWire{} = placeWire rm rw2 rw1
placeWire rm (RoomWire p _) (RoomWire q _) = foregroundShape
%~ ((col $ thinHighBarChain 80 $ map (shiftPointBy rs) doOrdering) <>)
where
@@ -73,7 +80,7 @@ placeWire rm (RoomWire p _) (RoomWire q _) = foregroundShape
--rmWalls = foldr cutWalls [] (_rmPolys rm)
doOrdering = orderPolygonAround rmcen (p:q:ps)
col | clockwise = colorSH red
| otherwise = colorSH orange
| otherwise = colorSH red
rmps = concat $ _rmPolys rm
rmcen = centroid rmps
clockwise = isLHS rmcen p q