Files
loop/src/Dodge/Wire.hs
T

36 lines
984 B
Haskell

module Dodge.Wire where
import Color
import Dodge.Data.GenWorld
import Dodge.Default.ForegroundShape
import Dodge.Room.Foreground
import Geometry
import qualified IntMapHelp as IM
import LensHelp
import Shape
import ShapePicture
floorWire :: Point2 -> Point2 -> ForegroundShape
floorWire a b =
defaultForeground
& fsPos .~ m
& fsRad .~ dist m a
& fsSPic .~ noPic (colorSH yellow $ thinHighBar 0 a' b')
where
m = midPoint a b
a' = a - m
b' = b - m
verticalWire :: Point2 -> Float -> Float -> ForegroundShape
verticalWire p h1 h2 =
defaultForeground
& fsPos .~ p
& fsRad .~ 2
& fsSPic .~ noPic (colorSH yellow $ barPP 1.5 (V3 0 0 h1) (V3 0 0 h2))
putWireEnd :: Int -> (Point2, Float) -> Float -> Room -> Room
putWireEnd i (p, a) h = rmEndWires %~ IM.insert i (WallWire p a h)
putWireStart :: Int -> (Point2, Float) -> Float -> Room -> Room
putWireStart i (p, a) h = rmStartWires %~ IM.insert i (WallWire p a h)