Add tilemap floors to rooms
This commit is contained in:
+8
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user