This commit is contained in:
2026-03-26 20:32:52 +00:00
parent 0ddedf7fd6
commit 9e42bb4117
+2 -5
View File
@@ -47,7 +47,7 @@ pushCr wls cr
& crPos . _xy .~ ap
| otherwise = ecr
where
stwls = IM.filter (\wl -> uncurry circOnSegNoEndpoints (wl ^. wlLine) sp r) wls
-- stwls = IM.filter (\wl -> uncurry circOnSegNoEndpoints (wl ^. wlLine) sp r) wls
twls = IM.elems $ IM.restrictKeys wls (ecr ^. crWallTouch) -- `IM.union` stwls
ep = ecr ^. crPos . _xy
ap = cr ^. crOldPos . _xy
@@ -63,12 +63,9 @@ wlsCrush [] = False
wlsCrush (x:xs) = any (wlWlCrush x) xs || wlsCrush xs
wlWlCrush :: Wall -> Wall -> Bool
wlWlCrush w1 w2 = norm (f w1 + f w2) < 0.5
wlWlCrush w1 w2 = norm (f w1 + f w2) < 0.2
where
f = normalizeV . uncurry (-) . (^. wlLine)
--wlWlCrush w1 w2 = angleVV (f w1) (f w2) > 0.75 * pi
-- where
-- f = uncurry (-) . (^. wlLine)
-- the amount to push creatures out from walls, extra to their radius
wallBuffer :: Float