|
@@ -8,11 +8,11 @@
|
|
|
namespace anki {
|
|
namespace anki {
|
|
|
|
|
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
|
-// ParticleSimple =
|
|
|
|
|
|
|
+// ParticleBase =
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
|
|
|
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
|
-ParticleSimple::ParticleSimple(
|
|
|
|
|
|
|
+ParticleBase::ParticleBase(
|
|
|
// SceneNode
|
|
// SceneNode
|
|
|
const char* name, Scene* scene,
|
|
const char* name, Scene* scene,
|
|
|
// Movable
|
|
// Movable
|
|
@@ -21,7 +21,7 @@ ParticleSimple::ParticleSimple(
|
|
|
{}
|
|
{}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
|
-ParticleSimple::~ParticleSimple()
|
|
|
|
|
|
|
+ParticleBase::~ParticleBase()
|
|
|
{}
|
|
{}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
@@ -36,7 +36,7 @@ Particle::Particle(
|
|
|
U32 movableFlags, Movable* movParent,
|
|
U32 movableFlags, Movable* movParent,
|
|
|
// RigidBody
|
|
// RigidBody
|
|
|
PhysWorld* masterContainer, const Initializer& init)
|
|
PhysWorld* masterContainer, const Initializer& init)
|
|
|
- : ParticleSimple(name, scene, movableFlags, movParent),
|
|
|
|
|
|
|
+ : ParticleBase(name, scene, movableFlags, movParent),
|
|
|
RigidBody(masterContainer, init, this)
|
|
RigidBody(masterContainer, init, this)
|
|
|
{}
|
|
{}
|
|
|
|
|
|
|
@@ -130,7 +130,8 @@ void ParticleEmitter::init(const char* filename, Scene* scene)
|
|
|
|
|
|
|
|
// copy the resource to me
|
|
// copy the resource to me
|
|
|
ParticleEmitterProperties& me = *this;
|
|
ParticleEmitterProperties& me = *this;
|
|
|
- const ParticleEmitterProperties& other = *particleEmitterResource;
|
|
|
|
|
|
|
+ const ParticleEmitterProperties& other =
|
|
|
|
|
+ particleEmitterResource->getProperties();
|
|
|
me = other;
|
|
me = other;
|
|
|
|
|
|
|
|
// create the particles
|
|
// create the particles
|
|
@@ -264,7 +265,7 @@ void ParticleEmitter::frameUpdate(F32 prevUpdateTime, F32 crntTime, I frame)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
//==============================================================================
|
|
|
-void ParticleEmitter::reanimateParticle(ParticleSimple& p, F32 crntTime)
|
|
|
|
|
|
|
+void ParticleEmitter::reanimateParticle(ParticleBase& p, F32 crntTime)
|
|
|
{
|
|
{
|
|
|
ANKI_ASSERT(p.isDead());
|
|
ANKI_ASSERT(p.isDead());
|
|
|
|
|
|
|
@@ -272,8 +273,8 @@ void ParticleEmitter::reanimateParticle(ParticleSimple& p, F32 crntTime)
|
|
|
RigidBody& body = *p.getRigidBody();
|
|
RigidBody& body = *p.getRigidBody();
|
|
|
|
|
|
|
|
// pre calculate
|
|
// pre calculate
|
|
|
- Bool forceFlag = particleEmitterResource->hasForce();
|
|
|
|
|
- Bool worldGravFlag = particleEmitterResource->usingWorldGravity();
|
|
|
|
|
|
|
+ Bool forceFlag = forceEnabled;
|
|
|
|
|
+ Bool worldGravFlag = wordGravityEnabled;
|
|
|
|
|
|
|
|
// life
|
|
// life
|
|
|
p.setTimeOfDeath(
|
|
p.setTimeOfDeath(
|