Refactor shader loading
This commit is contained in:
@@ -25,6 +25,7 @@ import Geometry.Vector
|
||||
import Geometry.LHS
|
||||
--import Geometry.Zone
|
||||
|
||||
import Data.Maybe
|
||||
import Data.List
|
||||
-- | Return a point a distance away from a first point towards a second point.
|
||||
-- Does not go past the second point.
|
||||
@@ -64,6 +65,13 @@ rectNSWE !n !s !w !e = [V2 w n, V2 w s, V2 e s, V2 e n]
|
||||
-- | Draw a rectangle around the origin with given height and width
|
||||
rectWdthHght :: Float -> Float -> [Point2]
|
||||
rectWdthHght w h = rectNSWE h (-h) (-w) w
|
||||
|
||||
mirrorXAxis :: [Point2] -> [Point2]
|
||||
mirrorXAxis ps = orderPolygon $ ps ++ mapMaybe f ps
|
||||
where
|
||||
f (V2 _ 0) = Nothing
|
||||
f (V2 x y) = Just $ V2 x (-y)
|
||||
|
||||
-- | Test whether a point is in a polygon or on the polygon border.
|
||||
-- Supposes the points in the
|
||||
-- polygon are listed in anticlockwise order.
|
||||
|
||||
Reference in New Issue
Block a user