Browse Source

fix particles

David Rose 19 years ago
parent
commit
39f37d0567

+ 1 - 1
panda/src/particlesystem/lineParticleRenderer.cxx

@@ -247,7 +247,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
 
   BoundingSphere sphere(aabb_center, radius);
   _line_primitive->set_bounds(&sphere);
-  get_render_node()->mark_bounds_stale();
+  get_render_node()->mark_internal_bounds_stale();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/particlesystem/pointParticleRenderer.cxx

@@ -286,7 +286,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
 
   BoundingSphere sphere(aabb_center, radius);
   _point_primitive->set_bounds(&sphere);
-  get_render_node()->mark_bounds_stale();
+  get_render_node()->mark_internal_bounds_stale();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/particlesystem/sparkleParticleRenderer.cxx

@@ -277,7 +277,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
 
   BoundingSphere sphere(aabb_center, radius);
   _line_primitive->set_bounds(&sphere);
-  get_render_node()->mark_bounds_stale();
+  get_render_node()->mark_internal_bounds_stale();
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/particlesystem/spriteParticleRenderer.cxx

@@ -766,7 +766,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
     }
   }
 
-  get_render_node()->mark_bounds_stale();
+  get_render_node()->mark_internal_bounds_stale();
   nassertv(render_node->check_valid());
   _animation_removed = false;
 }

+ 24 - 20
panda/src/pgraph/pandaNode.cxx

@@ -1847,6 +1847,30 @@ mark_bounds_stale(Thread *current_thread) const {
   CLOSE_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(_cycler);
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: PandaNode::mark_internal_bounds_stale
+//       Access: Published
+//  Description: Should be called by a derived class to mark the
+//               internal bounding volume stale, so that
+//               compute_internal_bounds() will be called when the
+//               bounding volume is next requested.
+//
+//               With no parameters, this means to iterate through all
+//               stages including and upstream of the current pipeline
+//               stage.
+//
+//               It is normally not necessary to call this method
+//               directly; each node should be responsible for calling
+//               it when its internals have changed.
+////////////////////////////////////////////////////////////////////
+void PandaNode::
+mark_internal_bounds_stale(Thread *current_thread) {
+  OPEN_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(_cycler, current_thread) {
+    mark_internal_bounds_stale(pipeline_stage, current_thread);
+  }
+  CLOSE_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(_cycler);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: PandaNode::is_geom_node
 //       Access: Published, Virtual
@@ -1986,26 +2010,6 @@ force_bounds_stale(int pipeline_stage, Thread *current_thread) {
   }
 }
 
-////////////////////////////////////////////////////////////////////
-//     Function: PandaNode::mark_internal_bounds_stale
-//       Access: Protected
-//  Description: Should be called by a derived class to mark the
-//               internal bounding volume stale, so that
-//               compute_internal_bounds() will be called when the
-//               bounding volume is next requested.
-//
-//               With no parameters, this means to iterate through all
-//               stages including and upstream of the current pipeline
-//               stage.
-////////////////////////////////////////////////////////////////////
-void PandaNode::
-mark_internal_bounds_stale(Thread *current_thread) {
-  OPEN_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(_cycler, current_thread) {
-    mark_internal_bounds_stale(pipeline_stage, current_thread);
-  }
-  CLOSE_ITERATE_CURRENT_AND_UPSTREAM_NOLOCK(_cycler);
-}
-
 ////////////////////////////////////////////////////////////////////
 //     Function: PandaNode::compute_internal_bounds
 //       Access: Protected, Virtual

+ 1 - 1
panda/src/pgraph/pandaNode.h

@@ -243,6 +243,7 @@ PUBLISHED:
   INLINE CPT(BoundingVolume) get_internal_bounds() const;
 
   void mark_bounds_stale(Thread *current_thread = Thread::get_current_thread()) const;
+  void mark_internal_bounds_stale(Thread *current_thread = Thread::get_current_thread());
 
   INLINE void set_final(bool flag);
   INLINE bool is_final(Thread *current_thread = Thread::get_current_thread()) const;
@@ -259,7 +260,6 @@ protected:
   INLINE void mark_bounds_stale(int pipeline_stage, Thread *current_thread) const;
   void force_bounds_stale(Thread *current_thread = Thread::get_current_thread());
   void force_bounds_stale(int pipeline_stage, Thread *current_thread);
-  void mark_internal_bounds_stale(Thread *current_thread = Thread::get_current_thread());
   INLINE void mark_internal_bounds_stale(int pipeline_stage, Thread *current_thread);
 
   virtual PT(BoundingVolume) compute_internal_bounds(int pipeline_stage, Thread *current_thread) const;