From 1e93d6403c660a5726bc226555f80c6b95b16bc1 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 11 Jan 2008 23:09:23 +0000 Subject: [PATCH] collide against event spheres in shadow collision pass, prevents gravity pulling detect sphere below event spheres --- direct/src/controls/GravityWalker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/direct/src/controls/GravityWalker.py b/direct/src/controls/GravityWalker.py index 6c4501a0c9..af3cf0c4a0 100755 --- a/direct/src/controls/GravityWalker.py +++ b/direct/src/controls/GravityWalker.py @@ -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):