This commit is contained in:
2026-04-05 15:18:00 +01:00
parent d5c98f7c4e
commit 017e92470e
+1 -3
View File
@@ -66,13 +66,11 @@ walkCliffPush cr xs = pushAgainst (cr ^. crOldPos . _xy - cr ^. crOldOldPos . _x
h = circSegsInside cxy (cr ^. crType . to crRad) h = circSegsInside cxy (cr ^. crType . to crRad)
groundCliffPush :: Creature -> [(Point2,Point2)] -> Point2 groundCliffPush :: Creature -> [(Point2,Point2)] -> Point2
groundCliffPush cr xs = x *^ h xs groundCliffPush cr xs = x *^ circSegsInside cxy r xs
where where
--x = max 0.05 $ 0.05 + 0.05 * (1 - dist cxy p / (2*r))
x = max 0 $ 0.25 * (1 - dist cxy p / (2*r)) ** 2 x = max 0 $ 0.25 * (1 - dist cxy p / (2*r)) ** 2
cxy = cr ^. crPos . _xy cxy = cr ^. crPos . _xy
r = cr ^. crType . to crRad r = cr ^. crType . to crRad
h = circSegsInside cxy r
p = circSegsInside' cxy r xs p = circSegsInside' cxy r xs
circSegsInside' :: Point2 -> Float -> [(Point2,Point2)] -> Point2 circSegsInside' :: Point2 -> Float -> [(Point2,Point2)] -> Point2