Fix shockwave damage radius for walls
This commit is contained in:
@@ -295,7 +295,7 @@ closestPointOnLineParam ::
|
||||
Float
|
||||
{-# INLINE closestPointOnLineParam #-}
|
||||
closestPointOnLineParam !a !b !p =
|
||||
(p -.- a) `dotV` (b -.- a) / (b -.- a) `dotV` (b -.- a)
|
||||
(p - a) `dotV` (b - a) / (b - a) `dotV` (b - a)
|
||||
|
||||
{- | Given a segment and external point, find the closest point on the segment.
|
||||
clamps to the end of the segment
|
||||
@@ -312,7 +312,7 @@ closestPointOnSeg segP1 segP2 p
|
||||
orthogonalPointOnSeg :: Point2 -> Point2 -> Point2 -> Maybe Point2
|
||||
orthogonalPointOnSeg a b p
|
||||
| param < 0 || param > 1 = Nothing
|
||||
| otherwise = Just $ a +.+ param *.* normalizeV (b -.- a)
|
||||
| otherwise = Just $ a + param *^ normalizeV (b - a)
|
||||
where
|
||||
param = closestPointOnLineParam a b p
|
||||
|
||||
|
||||
Reference in New Issue
Block a user