fix base.oobeCull()

This commit is contained in:
David Rose 2012-02-23 15:12:52 +00:00
parent a572d1a413
commit 89cc0051ae
1 changed files with 7 additions and 0 deletions

View File

@ -2320,6 +2320,9 @@ class ShowBase(DirectObject.DirectObject):
it were still attached to our original camera. This allows us
to visualize the effectiveness of our bounding volumes.
"""
if cam is None:
cam = self.cam
# First, make sure OOBE mode is enabled.
if not getattr(self, 'oobeMode', False):
self.oobe(cam = cam)
@ -2335,6 +2338,8 @@ class ShowBase(DirectObject.DirectObject):
# origin.
for c in base.camList:
c.node().setCullCenter(self.oobeCullFrustum)
if cam.node().isOfType(Camera):
cam.node().setCullCenter(self.oobeCullFrustum)
for c in cam.findAllMatches('**/+Camera'):
c.node().setCullCenter(self.oobeCullFrustum)
else:
@ -2342,6 +2347,8 @@ class ShowBase(DirectObject.DirectObject):
for c in base.camList:
c.node().setCullCenter(NodePath())
if cam.node().isOfType(Camera):
cam.node().setCullCenter(self.oobeCullFrustum)
for c in cam.findAllMatches('**/+Camera'):
c.node().setCullCenter(NodePath())
self.oobeCullFrustum.removeNode()