Move wall damages to external position
This commit is contained in:
@@ -22,6 +22,7 @@ module Dodge.Base.Collide
|
||||
, collidePointWalls
|
||||
, collidePointWallsNorm
|
||||
, collidePointWalls'
|
||||
, collidePointWallsFilt'
|
||||
, overlapCircWallsReturnWall
|
||||
, collideCircCrsPoint
|
||||
, collideCircCreatures
|
||||
@@ -373,6 +374,9 @@ collidePointWalls' p1 p2 = foldl' findPoint p2 . fmap _wlLine
|
||||
where
|
||||
findPoint p = fromMaybe p . uncurry (intersectSegSeg p1 p)
|
||||
|
||||
collidePointWallsFilt' :: (Wall -> Bool) -> Point2 -> Point2 -> IM.IntMap Wall -> Point2
|
||||
collidePointWallsFilt' t p1 p2 = collidePointWalls p1 p2 . IM.filter t
|
||||
|
||||
-- | Looks for first collision of a circle with walls.
|
||||
-- If found, gives point and reflection velocity, reflection damped in normal.
|
||||
-- note that the "intersection" point is the center of the circle flush against the wall
|
||||
|
||||
Reference in New Issue
Block a user