Fix crWallCollisions by using a rectangle zone instead of a point
This commit is contained in:
@@ -37,15 +37,17 @@ colCrWall w c
|
||||
%~ pushOutFromCorners rad ls'
|
||||
. pushOutFromWalls rad ls'
|
||||
. fst
|
||||
. flip (collidePoint p1) wls' -- check push throughs
|
||||
. flip (collidePoint p1) wls -- check push throughs
|
||||
-- . flip (collidePointWalls' p1) wls -- check push throughs
|
||||
rad = _crRad c + wallBuffer
|
||||
p1 = _crOldPos c
|
||||
p2 = _crPos c
|
||||
ls = _wlLine <$> wls
|
||||
ls' = filter (uncurry $ isLHS p1) ls
|
||||
wls' = filter (not . _wlWalkable) $ wlsNearPoint p2 w
|
||||
wls = filter (not . _wlWalkable) $ wlsNearPoint p2 w
|
||||
--wls = filter (not . _wlWalkable) $ wlsNearPoint p2 w
|
||||
wls = filter (not . _wlWalkable) $ wlsNearRect (p2 +.+ V2 r r) (p2 -.- V2 r r) w
|
||||
r = _crRad c
|
||||
--wls = filter (not . _wlWalkable) $ IM.elems $ _walls $ _lWorld $ _cWorld w
|
||||
|
||||
--wallPoints = map fst ls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user