Fix shockwave damage radius for walls

This commit is contained in:
2025-10-28 08:09:44 +00:00
parent 20042fcf8d
commit d6c4d3d609
16 changed files with 137 additions and 314 deletions
+2 -2
View File
@@ -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