mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
don't leave cray under node if not being used
This commit is contained in:
parent
106913d722
commit
e55a5136af
@ -55,7 +55,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
self.cRay = CollisionRay(0.0, 0.0, 4.0, 0.0, 0.0, -1.0)
|
self.cRay = CollisionRay(0.0, 0.0, 4.0, 0.0, 0.0, -1.0)
|
||||||
cRayNode = CollisionNode('shadowPlacer')
|
cRayNode = CollisionNode('shadowPlacer')
|
||||||
cRayNode.addSolid(self.cRay)
|
cRayNode.addSolid(self.cRay)
|
||||||
self.cRayNodePath = shadowNodePath.getParent().attachNewNode(cRayNode)
|
self.cRayNodePath = NodePath(cRayNode)
|
||||||
self.cRayBitMask = floorCollideMask
|
self.cRayBitMask = floorCollideMask
|
||||||
cRayNode.setFromCollideMask(self.cRayBitMask)
|
cRayNode.setFromCollideMask(self.cRayBitMask)
|
||||||
cRayNode.setIntoCollideMask(BitMask32.allOff())
|
cRayNode.setIntoCollideMask(BitMask32.allOff())
|
||||||
@ -99,6 +99,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
assert self.cTrav.hasCollider(self.cRayNodePath)
|
assert self.cTrav.hasCollider(self.cRayNodePath)
|
||||||
return
|
return
|
||||||
assert not self.cTrav.hasCollider(self.cRayNodePath)
|
assert not self.cTrav.hasCollider(self.cRayNodePath)
|
||||||
|
self.cRayNodePath.reparentTo(self.shadowNodePath.getParent())
|
||||||
self.cTrav.addCollider(self.cRayNodePath, self.lifter)
|
self.cTrav.addCollider(self.cRayNodePath, self.lifter)
|
||||||
self.isActive = 1
|
self.isActive = 1
|
||||||
if __debug__:
|
if __debug__:
|
||||||
@ -118,6 +119,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
assert self.cTrav.hasCollider(self.cRayNodePath)
|
assert self.cTrav.hasCollider(self.cRayNodePath)
|
||||||
didIt = self.cTrav.removeCollider(self.cRayNodePath)
|
didIt = self.cTrav.removeCollider(self.cRayNodePath)
|
||||||
assert didIt
|
assert didIt
|
||||||
|
self.cRayNodePath.detachNode()
|
||||||
# Now that we have disabled collisions, make one more pass
|
# Now that we have disabled collisions, make one more pass
|
||||||
# right now to ensure we aren't standing in a wall.
|
# right now to ensure we aren't standing in a wall.
|
||||||
self.oneTimeCollide()
|
self.oneTimeCollide()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user