Files
loop/src/Dodge/Base/Wall.hs
T

26 lines
707 B
Haskell

module Dodge.Base.Wall where
import Dodge.Data.Wall
import Geometry
wlIsOpaque :: Wall -> Bool
wlIsOpaque wl = case _wlOpacity wl of
Opaque {} -> True
_ -> False
wlIsSeeThrough :: Wall -> Bool
wlIsSeeThrough wl = case _wlOpacity wl of
SeeThrough -> True
_ -> False
reflDirWall :: Point2 -> Point2 -> Wall -> Float
reflDirWall sp ep wl = argV (reflectIn (uncurry (-.-) (_wlLine wl)) (ep -.- sp))
-- point free nonsense. 0 for no damping, 1 for full damping
reflVelWallDamp :: Float -> Wall -> Point2 -> Point2
reflVelWallDamp x = reflectInParam x . uncurry (-.-) . _wlLine
-- point free nonsense
reflVelWall :: Wall -> Point2 -> Point2
reflVelWall = reflectIn . uncurry (-.-) . _wlLine