collide against event spheres in shadow collision pass, prevents gravity pulling detect sphere below event spheres

This commit is contained in:
Darren Ranalli 2008-01-11 23:09:23 +00:00
parent 8e57270adf
commit 1e93d6403c

View File

@ -358,7 +358,6 @@ class GravityWalker(DirectObject.DirectObject):
self.cTrav.addCollider(self.cWallSphereNodePath, self.pusher)
if self.wantFloorSphere:
self.cTrav.addCollider(self.cFloorSphereNodePath, self.pusherFloor)
self.cTrav.addCollider(self.cEventSphereNodePath, self.event)
# Add the lifter to the shadow traverser, which runs after
# our traverser. This prevents the "fall through wall and
# off ledge" bug. The problem was that we couldn't control
@ -367,12 +366,15 @@ class GravityWalker(DirectObject.DirectObject):
# collided first, we'd start falling before getting pushed
# back behind the wall.
base.shadowTrav.addCollider(self.cRayNodePath, self.lifter)
# also put the event sphere in the shadowTrav, so we collide with
# event spheres from our final position for the frame
base.shadowTrav.addCollider(self.cEventSphereNodePath, self.event)
else:
if hasattr(self, 'cTrav'):
self.cTrav.removeCollider(self.cWallSphereNodePath)
if self.wantFloorSphere:
self.cTrav.removeCollider(self.cFloorSphereNodePath)
self.cTrav.removeCollider(self.cEventSphereNodePath)
base.shadowTrav.removeCollider(self.cEventSphereNodePath)
base.shadowTrav.removeCollider(self.cRayNodePath)
def getCollisionsActive(self):