*** empty log message ***

This commit is contained in:
David Rose 2001-02-16 16:37:58 +00:00
parent dd31c5dda6
commit 3d72d7c71b

View File

@ -615,13 +615,24 @@ class Actor(PandaObject, NodePath):
Actor.notify.warning("no lod named %s!" % (lodName)) Actor.notify.warning("no lod named %s!" % (lodName))
def stackDecals(self, frontPartName, backPartName, root=None, def drawInFront(self, frontPartName, backPartName, mode,
lodName=None): root=None, lodName=None):
"""stackDecals(self, string, string=None, key=None) """drawInFront(self, string, int, string=None, key=None)
Arrange geometry so the frontPart is drawn as a decal onto Arrange geometry so the frontPart is drawn in front of backPart.
backPart. This assumes that frontPart is mostly coplanar with
and does not extend beyond backPart. If mode == 0, the geometry is simply arranged to be drawn in
the correct order.
If mode < 0, one step further is taken: frontPart is drawn
as a decal onto backPart. This assumes that frontPart is
mostly coplanar with and does not extend beyond backPart, and
that backPart is mostly flat (not self-occluding).
If mode > 0, the frontPart geometry is placed in the 'fixed'
bin, with the indicated drawing order. This will cause it to
be drawn after almost all other geometry. In this case, the
backPartName is actually unused.
Takes an optional argument root as the start of the search for the Takes an optional argument root as the start of the search for the
given parts. Also takes optional lod name to refine search for the given parts. Also takes optional lod name to refine search for the
@ -643,25 +654,39 @@ class Actor(PandaObject, NodePath):
if (root == None): if (root == None):
root = self root = self
# In case people don't have an up-to-date Panda, we'll fall frontParts = root.findAllMatches( "**/" + frontPartName)
# back on DirectRenderTransition. if mode > 0:
# Use the 'fixed' bin instead of reordering the scene
# graph.
numFrontParts = frontParts.getNumPaths()
for partNum in range(0, numFrontParts):
frontParts.getPath(partNum).setBin('fixed', mode)
return
# Find the back part.
backPart = root.find("**/" + backPartName)
if (backPart.isEmpty()):
Actor.notify.warning("no part named %s!" % (backPartName))
return
if mode < 0:
# Draw as a decal. In case people don't have an
# up-to-date Panda, we'll fall back on
# DirectRenderTransition.
try: try:
dt = DecalTransition() dt = DecalTransition()
except: except:
dt = DirectRenderTransition() dt = DirectRenderTransition()
# make the back part have the proper transition
backPart = root.find("**/" + backPartName)
if (backPart.isEmpty()):
Actor.notify.warning("no part named %s!" % (backPartName))
else: else:
dt = DirectRenderTransition()
# make the back part have the proper transition
backPart.getBottomArc().setTransition(dt) backPart.getBottomArc().setTransition(dt)
#reparent the front parts to the back part #reparent all the front parts to the back part
frontParts = root.findAllMatches( "**/" + frontPartName) frontParts.reparentTo(backPart)
numFrontParts = frontParts.getNumPaths()
for partNum in range(0, numFrontParts):
(frontParts.getPath(partNum)).reparentTo(backPart)
def fixBounds(self, part=None): def fixBounds(self, part=None):