|
@@ -79,6 +79,7 @@ public:
|
|
|
/// Kill the particle
|
|
/// Kill the particle
|
|
|
virtual void kill()
|
|
virtual void kill()
|
|
|
{
|
|
{
|
|
|
|
|
+ ANKI_ASSERT(timeOfDeath > 0.0);
|
|
|
timeOfDeath = -1.0;
|
|
timeOfDeath = -1.0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -91,6 +92,15 @@ public:
|
|
|
(void)crntTime;
|
|
(void)crntTime;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// Only relevant for non-bullet simulations
|
|
|
|
|
+ virtual void simulate(const ParticleEmitter& pe,
|
|
|
|
|
+ F32 prevUpdateTime, F32 crntTime)
|
|
|
|
|
+ {
|
|
|
|
|
+ (void)pe;
|
|
|
|
|
+ (void)prevUpdateTime;
|
|
|
|
|
+ (void)crntTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
protected:
|
|
protected:
|
|
|
F32 timeOfBirth; ///< Keep the time of birth for nice effects
|
|
F32 timeOfBirth; ///< Keep the time of birth for nice effects
|
|
|
F32 timeOfDeath = -1.0; ///< Time of death. If < 0.0 then dead. In seconds
|
|
F32 timeOfDeath = -1.0; ///< Time of death. If < 0.0 then dead. In seconds
|
|
@@ -107,9 +117,7 @@ public:
|
|
|
// SceneNode
|
|
// SceneNode
|
|
|
const char* name, Scene* scene,
|
|
const char* name, Scene* scene,
|
|
|
// Movable
|
|
// Movable
|
|
|
- U32 movableFlags, Movable* movParent)
|
|
|
|
|
- : ParticleBase(PT_SIMPLE, name, scene, movableFlags, movParent)
|
|
|
|
|
- {}
|
|
|
|
|
|
|
+ U32 movableFlags, Movable* movParent);
|
|
|
|
|
|
|
|
void revive(const ParticleEmitter& pe,
|
|
void revive(const ParticleEmitter& pe,
|
|
|
F32 prevUpdateTime, F32 crntTime)
|
|
F32 prevUpdateTime, F32 crntTime)
|
|
@@ -118,6 +126,8 @@ public:
|
|
|
velocity = Vec3(0.0);
|
|
velocity = Vec3(0.0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ void simulate(const ParticleEmitter& pe, F32 prevUpdateTime, F32 crntTime);
|
|
|
|
|
+
|
|
|
private:
|
|
private:
|
|
|
/// The velocity
|
|
/// The velocity
|
|
|
Vec3 velocity = Vec3(0.0);
|
|
Vec3 velocity = Vec3(0.0);
|
|
@@ -162,6 +172,7 @@ class ParticleEmitter: public SceneNode, public Spatial, public Movable,
|
|
|
public Renderable, private ParticleEmitterProperties
|
|
public Renderable, private ParticleEmitterProperties
|
|
|
{
|
|
{
|
|
|
friend class Particle;
|
|
friend class Particle;
|
|
|
|
|
+ friend class ParticleSimple;
|
|
|
|
|
|
|
|
public:
|
|
public:
|
|
|
ParticleEmitter(
|
|
ParticleEmitter(
|