mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
added comments
This commit is contained in:
parent
cf9f1822b5
commit
9a78635250
@ -17,6 +17,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
# special methods
|
# special methods
|
||||||
def __init__(self, cTrav, shadowNodePath,
|
def __init__(self, cTrav, shadowNodePath,
|
||||||
wallCollideMask, floorCollideMask):
|
wallCollideMask, floorCollideMask):
|
||||||
|
assert self.debugPrint("ShadowPlacer()")
|
||||||
DirectObject.DirectObject.__init__(self)
|
DirectObject.DirectObject.__init__(self)
|
||||||
self.setup(cTrav, shadowNodePath,
|
self.setup(cTrav, shadowNodePath,
|
||||||
wallCollideMask, floorCollideMask)
|
wallCollideMask, floorCollideMask)
|
||||||
@ -26,6 +27,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
Set up the collisions
|
Set up the collisions
|
||||||
"""
|
"""
|
||||||
|
assert self.debugPrint("setup()")
|
||||||
assert not shadowNodePath.isEmpty()
|
assert not shadowNodePath.isEmpty()
|
||||||
|
|
||||||
self.cTrav = cTrav
|
self.cTrav = cTrav
|
||||||
@ -54,6 +56,7 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
self.lifter.addColliderNode(self.cRayNode, shadowNodePath.node())
|
self.lifter.addColliderNode(self.cRayNode, shadowNodePath.node())
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
|
assert self.debugPrint("delete()")
|
||||||
del self.cTrav
|
del self.cTrav
|
||||||
|
|
||||||
del self.shadowNodePath
|
del self.shadowNodePath
|
||||||
@ -66,12 +69,23 @@ class ShadowPlacer(DirectObject.DirectObject):
|
|||||||
del self.lifter
|
del self.lifter
|
||||||
|
|
||||||
def off(self):
|
def off(self):
|
||||||
|
"""
|
||||||
|
Turn off the shadow placement. The shadow will still be
|
||||||
|
there, but the z position will not be updated until a call
|
||||||
|
to on() is made.
|
||||||
|
"""
|
||||||
|
assert self.debugPrint("off()")
|
||||||
self.cTrav.removeCollider(self.cRayNode)
|
self.cTrav.removeCollider(self.cRayNode)
|
||||||
# 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()
|
||||||
|
|
||||||
def on(self):
|
def on(self):
|
||||||
|
"""
|
||||||
|
Turn on the shadow placement. The shadow z position will
|
||||||
|
start being updated until a call to off() is made.
|
||||||
|
"""
|
||||||
|
assert self.debugPrint("on()")
|
||||||
self.cTrav.addCollider(self.cRayNode, self.lifter)
|
self.cTrav.addCollider(self.cRayNode, self.lifter)
|
||||||
|
|
||||||
def oneTimeCollide(self):
|
def oneTimeCollide(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user