mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
collide against event spheres in shadow collision pass, prevents gravity pulling detect sphere below event spheres
This commit is contained in:
parent
8e57270adf
commit
1e93d6403c
@ -358,7 +358,6 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
self.cTrav.addCollider(self.cWallSphereNodePath, self.pusher)
|
self.cTrav.addCollider(self.cWallSphereNodePath, self.pusher)
|
||||||
if self.wantFloorSphere:
|
if self.wantFloorSphere:
|
||||||
self.cTrav.addCollider(self.cFloorSphereNodePath, self.pusherFloor)
|
self.cTrav.addCollider(self.cFloorSphereNodePath, self.pusherFloor)
|
||||||
self.cTrav.addCollider(self.cEventSphereNodePath, self.event)
|
|
||||||
# Add the lifter to the shadow traverser, which runs after
|
# Add the lifter to the shadow traverser, which runs after
|
||||||
# our traverser. This prevents the "fall through wall and
|
# our traverser. This prevents the "fall through wall and
|
||||||
# off ledge" bug. The problem was that we couldn't control
|
# 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
|
# collided first, we'd start falling before getting pushed
|
||||||
# back behind the wall.
|
# back behind the wall.
|
||||||
base.shadowTrav.addCollider(self.cRayNodePath, self.lifter)
|
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:
|
else:
|
||||||
if hasattr(self, 'cTrav'):
|
if hasattr(self, 'cTrav'):
|
||||||
self.cTrav.removeCollider(self.cWallSphereNodePath)
|
self.cTrav.removeCollider(self.cWallSphereNodePath)
|
||||||
if self.wantFloorSphere:
|
if self.wantFloorSphere:
|
||||||
self.cTrav.removeCollider(self.cFloorSphereNodePath)
|
self.cTrav.removeCollider(self.cFloorSphereNodePath)
|
||||||
self.cTrav.removeCollider(self.cEventSphereNodePath)
|
base.shadowTrav.removeCollider(self.cEventSphereNodePath)
|
||||||
base.shadowTrav.removeCollider(self.cRayNodePath)
|
base.shadowTrav.removeCollider(self.cRayNodePath)
|
||||||
|
|
||||||
def getCollisionsActive(self):
|
def getCollisionsActive(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user