Fix explosion damage

This commit is contained in:
2022-07-11 20:26:19 +01:00
parent 1506f5a83e
commit 791d065eff
10 changed files with 87 additions and 74 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ overlapCircWalls :: Point2 -> Float -> StreamOf Wall
overlapCircWalls p r = S.mapMaybe dointersect
where
dointersect wl = f (_wlLine wl) <&> (,wl)
f (a,b) = intersectSegSeg p (p -.- r *.* vNormal (normalizeV (a -.- b))) a b
f (a,b) = intersectSegSeg p (p +.+ r *.* normalizeV ((0.5 *.* (a +.+ b)) -.- p)) a b
-- | note that this does not push the circle away from the wall at all
collideCircWallsStream :: Point2 -> Point2 -> Float -> StreamOf Wall