Browse Source

fix base.oobeCull()

David Rose 14 years ago
parent
commit
89cc0051ae
1 changed files with 7 additions and 0 deletions
  1. 7 0
      direct/src/showbase/ShowBase.py

+ 7 - 0
direct/src/showbase/ShowBase.py

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