Przeglądaj źródła

workaround for culling bugs

David Rose 24 lat temu
rodzic
commit
ff97614e76
2 zmienionych plików z 16 dodań i 0 usunięć
  1. 15 0
      direct/src/actor/Actor.py
  2. 1 0
      direct/src/showbase/ShowBase.py

+ 15 - 0
direct/src/actor/Actor.py

@@ -188,6 +188,21 @@ class Actor(PandaObject, NodePath):
             
             # copy the anim dictionary from other
             self.__copyAnimControls(other)
+
+        # For now, all Actors will by default set their top bounding
+        # volume to be the "final" bounding volume: the bounding
+        # volumes below the top volume will not be tested.  If a 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
+        # small object relative to the scene, and is pretty much going
+        # to be all onscreen or all offscreen anyway; and partly
+        # because of the Character bug that doesn't update the
+        # bounding volume for pieces that animate away from their
+        # original position.  It's disturbing to see someone's hands
+        # disappear; better to cull the whole object or none of it.
+        self.__geomNode.arc().setFinal(1)
             
     def delete(self):
         try:

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

@@ -450,6 +450,7 @@ class ShowBase:
             self.oobeButtonEventsType = TypeRegistry.ptr().findType('ButtonEvents_ButtonEventDataTransition')
 
             self.oobeVis = loader.loadModelOnce('models/misc/camera')
+            self.oobeVis.arc().setFinal(1)
             self.oobeCullFrustum = None
 
             # Make sure the MouseValve is monitoring the Control key.