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))
