소스 검색

*** empty log message ***

Josh Wilson 20 년 전
부모
커밋
82d5bda6a5
2개의 변경된 파일26개의 추가작업 그리고 0개의 파일을 삭제
  1. 25 0
      panda/src/particlesystem/particleSystem.I
  2. 1 0
      panda/src/particlesystem/particleSystem.h

+ 25 - 0
panda/src/particlesystem/particleSystem.I

@@ -41,6 +41,31 @@ induce_labor() {
   _tics_since_birth = _birth_rate;
 }
 
+////////////////////////////////////////////////////////////////////
+//    Function : clear_to_initial
+//      Access : Public
+// Description : Resets the system to its start state by resizing to 0,
+//               then resizing back to current size.
+////////////////////////////////////////////////////////////////////
+
+INLINE void ParticleSystem::
+clear_to_initial() {
+  BaseParticle *bp;
+  int index;
+  int i;
+
+  //int particle_pool_size = _particle_pool_size;
+  //resize_pool(0);
+  //resize_pool(particle_pool_size);
+
+  for(i = 0; i < _physics_objects.size(); i++)
+    {
+      bp = (BaseParticle *)_physics_objects[i].p();
+      if(bp->get_alive())
+        kill_particle(i);
+    }
+}
+
 ////             ///////////////////////////////////////////////////////
 //// SET METHODS ///////////////////////////////////////////////////////
 ////             ///////////////////////////////////////////////////////

+ 1 - 0
panda/src/particlesystem/particleSystem.h

@@ -101,6 +101,7 @@ PUBLISHED:
 
   INLINE void render();
   INLINE void induce_labor();
+  INLINE void clear_to_initial();
   void update(float dt);
 
   virtual void output(ostream &out) const;