Refactor shader loading

This commit is contained in:
2021-09-22 11:22:23 +01:00
parent 952ec1c579
commit a4fbe6126c
5 changed files with 133 additions and 78 deletions
+8
View File
@@ -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.