Files
loop/src/Dodge/LevelGen/DoorPane.hs
T
2021-10-31 19:46:32 +00:00

20 lines
409 B
Haskell

module Dodge.LevelGen.DoorPane
( rectanglePairs
) where
import Geometry.Vector
import Geometry.Data
rectanglePairs :: Float -> Point2 -> Point2 -> [(Point2,Point2)]
rectanglePairs wdth a b =
[ (aup, ad)
, (ad, bd)
, (bd, bu)
, (bu, aup)
]
where
aup = a +.+ norm
ad = a -.- norm
bu = b +.+ norm
bd = b -.- norm
norm = wdth *.* normalizeV ( vNormal (b -.- a))