Pārlūkot izejas kodu

Added ability to force birth of a particle litter

Mark Mine 23 gadi atpakaļ
vecāks
revīzija
141cb888f6

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

@@ -29,6 +29,18 @@ render(void) {
   _renderer->render(_physics_objects, _living_particles);
   _renderer->render(_physics_objects, _living_particles);
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//    Function : induce_labor
+//      Access : Public
+// Description : Forces the birth of a particle litter this frame
+//               by resetting _tics_since_birth
+////////////////////////////////////////////////////////////////////
+
+INLINE void ParticleSystem::
+induce_labor(void) {
+  _tics_since_birth = _birth_rate;
+}
+
 ////             ///////////////////////////////////////////////////////
 ////             ///////////////////////////////////////////////////////
 //// SET METHODS ///////////////////////////////////////////////////////
 //// SET METHODS ///////////////////////////////////////////////////////
 ////             ///////////////////////////////////////////////////////
 ////             ///////////////////////////////////////////////////////

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

@@ -146,6 +146,7 @@ PUBLISHED:
   // methods
   // methods
 
 
   INLINE void render(void);
   INLINE void render(void);
+  INLINE void induce_labor(void);
   void update(float dt);
   void update(float dt);
 
 
 public:
 public: