Cleanup
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
module Dodge.LevelGen.DoorPane ( rectanglePairs) where
|
||||
import Geometry.Vector
|
||||
import Geometry.Data
|
||||
module Dodge.LevelGen.DoorPane (mkRectangle) where
|
||||
|
||||
rectanglePairs :: Float -> Point2 -> Point2 -> [(Point2,Point2)]
|
||||
rectanglePairs wdth a b =
|
||||
[ (aup, ad)
|
||||
, (ad, bd)
|
||||
, (bd, bu)
|
||||
, (bu, aup)
|
||||
]
|
||||
import Geometry.Data
|
||||
import Geometry.Vector
|
||||
import Linear
|
||||
|
||||
mkRectangle :: Float -> Point2 -> [ Point2]
|
||||
mkRectangle wdth b = [ n , - n , b - n , b + n ]
|
||||
where
|
||||
aup = a +.+ norm
|
||||
ad = a -.- norm
|
||||
bu = b +.+ norm
|
||||
bd = b -.- norm
|
||||
norm = wdth *.* normalizeV ( vNormal (b -.- a))
|
||||
n = wdth *^ normalizeV (vNormal b)
|
||||
|
||||
Reference in New Issue
Block a user