Add concept of GameRoom, check viewing distance based on rooms
This commit is contained in:
@@ -133,14 +133,21 @@ cutPoly qs wls =
|
||||
ps = orderPolygon qs
|
||||
rs = orderPolygon $ nubOrd $ zs ++ qs
|
||||
-- | Given a value and a poly, pushes the poly points out from the center by the
|
||||
-- value amount.
|
||||
-- factor amount.
|
||||
expandPolyBy :: Float -> [Point2] -> [Point2]
|
||||
expandPolyBy x ps = map f ps
|
||||
where
|
||||
--cp = 1/fromIntegral (length ps) *.* foldl' (+.+) (V2 0 0) ps
|
||||
cp = centroid ps
|
||||
f p = p +.+ x *.* (p -.- cp)
|
||||
--f p = p +.+ x *.* normalizeV (p -.- cp)
|
||||
-- | Given a value and a poly, pushes the poly points out from the center by the
|
||||
-- fixed amount.
|
||||
expandPolyByFixed :: Float -> [Point2] -> [Point2]
|
||||
expandPolyByFixed x ps = map f ps
|
||||
where
|
||||
--cp = 1/fromIntegral (length ps) *.* foldl' (+.+) (V2 0 0) ps
|
||||
cp = centroid ps
|
||||
f p = p +.+ x *.* safeNormalizeV (p -.- cp)
|
||||
-- | Given a polygon expressed as a list of points and a collection of walls,
|
||||
-- returns:
|
||||
-- fst: points of the polygon's intersection with walls
|
||||
|
||||
Reference in New Issue
Block a user