only avatars do setFinal() by default

This commit is contained in:
David Rose 2007-06-08 23:23:36 +00:00
parent 0c7e4a83b9
commit 3971dfc49b

View File

@ -85,7 +85,7 @@ class Actor(DirectObject, NodePath):
return 'Actor.SubpartDef(%s, %s)' % (repr(self.truePartName), repr(self.subset)) return 'Actor.SubpartDef(%s, %s)' % (repr(self.truePartName), repr(self.subset))
def __init__(self, models=None, anims=None, other=None, copy=1, def __init__(self, models=None, anims=None, other=None, copy=1,
lodNode = None, flattenable = 1): lodNode = None, flattenable = 1, setFinal = 0):
"""__init__(self, string | string:string{}, string:string{} | """__init__(self, string | string:string{}, string:string{} |
string:(string:string{}){}, Actor=None) string:(string:string{}){}, Actor=None)
Actor constructor: can be used to create single or multipart Actor constructor: can be used to create single or multipart
@ -273,20 +273,22 @@ class Actor(DirectObject, NodePath):
else: else:
self.copyActor(other, True) # overwrite everything self.copyActor(other, True) # overwrite everything
# For now, all Actors will by default set their top bounding if setFinal:
# volume to be the "final" bounding volume: the bounding # If setFinal is true, the Actor will set its top bounding
# volumes below the top volume will not be tested. If a cull # volume to be the "final" bounding volume: the bounding
# test passes the top bounding volume, the whole Actor is # volumes below the top volume will not be tested. If a
# rendered. # cull test passes the top bounding volume, the whole
# Actor is rendered.
# We do this partly because an Actor is likely to be a fairly # We do this partly because an Actor is likely to be a
# small object relative to the scene, and is pretty much going # fairly small object relative to the scene, and is pretty
# to be all onscreen or all offscreen anyway; and partly # much going to be all onscreen or all offscreen anyway;
# because of the Character bug that doesn't update the # and partly because of the Character bug that doesn't
# bounding volume for pieces that animate away from their # update the bounding volume for pieces that animate away
# original position. It's disturbing to see someone's hands # from their original position. It's disturbing to see
# disappear; better to cull the whole object or none of it. # someone's hands disappear; better to cull the whole
self.__geomNode.node().setFinal(1) # object or none of it.
self.__geomNode.node().setFinal(1)
def delete(self): def delete(self):
try: try: