mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
controls: Don't make scene graph assumptions when setting the CollisionRay's height
This commit is contained in:
parent
dafae50ce2
commit
946f273ebb
@ -179,9 +179,9 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
# a higher or lower value depending on whether you want an avatar
|
||||
# that is outside of the world to step up to the floor when they
|
||||
# get under valid floor:
|
||||
cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
|
||||
self.cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
|
||||
cRayNode = CollisionNode('GW.cRayNode')
|
||||
cRayNode.addSolid(cRay)
|
||||
cRayNode.addSolid(self.cRay)
|
||||
self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
|
||||
cRayNode.setFromCollideMask(bitmask)
|
||||
cRayNode.setIntoCollideMask(BitMask32.allOff())
|
||||
@ -697,8 +697,4 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
# There are sometimes issues if the collision ray height is
|
||||
# so tall that it collides with multiple levels of floors.
|
||||
def setCollisionRayHeight(self, height):
|
||||
oldNode = self.avatarNodePath.getNode(0)
|
||||
cRayNode = oldNode.getChild(2)
|
||||
cRayNode.removeSolid(0)
|
||||
cRay = CollisionRay(0.0, 0.0, height, 0.0, 0.0, -1.0)
|
||||
cRayNode.addSolid(cRay)
|
||||
self.cRay.setOrigin(0.0, 0.0, height)
|
||||
|
Loading…
x
Reference in New Issue
Block a user