Cleanup
This commit is contained in:
@@ -47,7 +47,7 @@ pushCr wls cr
|
|||||||
& crPos . _xy .~ ap
|
& crPos . _xy .~ ap
|
||||||
| otherwise = ecr
|
| otherwise = ecr
|
||||||
where
|
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
|
twls = IM.elems $ IM.restrictKeys wls (ecr ^. crWallTouch) -- `IM.union` stwls
|
||||||
ep = ecr ^. crPos . _xy
|
ep = ecr ^. crPos . _xy
|
||||||
ap = cr ^. crOldPos . _xy
|
ap = cr ^. crOldPos . _xy
|
||||||
@@ -63,12 +63,9 @@ wlsCrush [] = False
|
|||||||
wlsCrush (x:xs) = any (wlWlCrush x) xs || wlsCrush xs
|
wlsCrush (x:xs) = any (wlWlCrush x) xs || wlsCrush xs
|
||||||
|
|
||||||
wlWlCrush :: Wall -> Wall -> Bool
|
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
|
where
|
||||||
f = normalizeV . uncurry (-) . (^. wlLine)
|
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
|
-- the amount to push creatures out from walls, extra to their radius
|
||||||
wallBuffer :: Float
|
wallBuffer :: Float
|
||||||
|
|||||||
Reference in New Issue
Block a user