Add tilemap floors to rooms

This commit is contained in:
jgk
2021-06-15 14:56:32 +02:00
parent 73bd407c49
commit da631e3b37
31 changed files with 181 additions and 66 deletions
+8 -1
View File
@@ -10,7 +10,7 @@ Line refers to a line defined by two points, and extends beyond the two points.
-}
module Geometry
( module Geometry
, module Geometry.Data
-- , module Geometry.Data
, module Geometry.Intersect
, module Geometry.Bezier
, module Geometry.Vector
@@ -225,6 +225,13 @@ polysOverlap _ _ = False
-- a second list.
anyPolyssIntersect :: [[Point2]] -> [[Point2]] -> Bool
anyPolyssIntersect x y = or $ polysIntersect <$> x <*> y
-- split a list into triples, forms triangles from a polygon
polyToTris :: [s] -> [s]
{-# INLINE polyToTris #-}
polyToTris (a:b:c:as) = a : intercalate [a] (zipWith (\x y->[x,y]) (init (b:c:as)) (c:as))
polyToTris _ = []
-- | Return n equidistant points on a circle with a radius of 600.
nRays :: Int -> [Point2]
nRays n = take n $ iterate (rotateV (2*pi/fromIntegral n)) (600,0)