Graphics/ParticleGroup: Remove fixed step parameter (wasn't used)
Former-commit-id: 28e6d1d11ac699d184e9f0ca90994c1ae6368962 [formerly 696269b6f34dd4f9f61fd1c1f4b93bd2a50fdcdf] Former-commit-id: d3fbf42609596a03cde0cdaf1256dd014e87087e
This commit is contained in:
parent
3a50c1e553
commit
e68b962f4d
|
|
@ -40,19 +40,14 @@ namespace Nz
|
|||
void* CreateParticle();
|
||||
void* CreateParticles(unsigned int count);
|
||||
|
||||
void EnableFixedStep(bool fixedStep);
|
||||
|
||||
void* GenerateParticle();
|
||||
void* GenerateParticles(unsigned int count);
|
||||
|
||||
const ParticleDeclarationConstRef& GetDeclaration() const;
|
||||
float GetFixedStepSize() const;
|
||||
unsigned int GetMaxParticleCount() const;
|
||||
unsigned int GetParticleCount() const;
|
||||
unsigned int GetParticleSize() const;
|
||||
|
||||
bool IsFixedStepEnabled() const;
|
||||
|
||||
void KillParticle(unsigned int index);
|
||||
void KillParticles();
|
||||
|
||||
|
|
@ -60,7 +55,6 @@ namespace Nz
|
|||
void RemoveEmitter(ParticleEmitter* emitter);
|
||||
void RemoveGenerator(ParticleGenerator* generator);
|
||||
|
||||
void SetFixedStepSize(float stepSize);
|
||||
void SetRenderer(ParticleRenderer* renderer);
|
||||
|
||||
void Update(float elapsedTime);
|
||||
|
|
@ -79,10 +73,7 @@ namespace Nz
|
|||
std::vector<ParticleGeneratorRef> m_generators;
|
||||
ParticleDeclarationConstRef m_declaration;
|
||||
ParticleRendererRef m_renderer;
|
||||
bool m_fixedStepEnabled;
|
||||
bool m_processing;
|
||||
float m_stepAccumulator;
|
||||
float m_stepSize;
|
||||
unsigned int m_maxParticleCount;
|
||||
unsigned int m_particleCount;
|
||||
unsigned int m_particleSize;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ namespace Nz
|
|||
* \param particleCount Number of particles
|
||||
* \param elapsedTime Delta time between the previous frame
|
||||
*/
|
||||
|
||||
void ParticleGroup::ApplyControllers(ParticleMapper& mapper, unsigned int particleCount, float elapsedTime)
|
||||
{
|
||||
m_processing = true;
|
||||
|
|
@ -174,8 +173,8 @@ namespace Nz
|
|||
if (m_dyingParticles.size() < m_particleCount)
|
||||
{
|
||||
// We kill them in reverse order, std::set sorting them via std::greater
|
||||
// The reason is simple, as the death of a particle means the move of the last particle in the buffer,
|
||||
// without this solution, certain particles could avoid the death
|
||||
// The reason is simple, as the death of a particle means moving the last particle in the buffer,
|
||||
// without this solution, certain particles could avoid death
|
||||
for (unsigned int index : m_dyingParticles)
|
||||
KillParticle(index);
|
||||
}
|
||||
|
|
@ -252,16 +251,6 @@ namespace Nz
|
|||
return m_declaration;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the fixed step size
|
||||
* \return Current fixed step size
|
||||
*/
|
||||
|
||||
float ParticleGroup::GetFixedStepSize() const
|
||||
{
|
||||
return m_stepSize;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the maximum number of particles
|
||||
* \return Current maximum number
|
||||
|
|
@ -292,16 +281,6 @@ namespace Nz
|
|||
return m_particleSize;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the fixed step is enabled
|
||||
* \return true If it is the case
|
||||
*/
|
||||
|
||||
bool ParticleGroup::IsFixedStepEnabled() const
|
||||
{
|
||||
return m_fixedStepEnabled;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Kills one particle
|
||||
*
|
||||
|
|
@ -372,17 +351,6 @@ namespace Nz
|
|||
m_generators.erase(it);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the fixed step size
|
||||
*
|
||||
* \param stepSize Fixed step size
|
||||
*/
|
||||
|
||||
void ParticleGroup::SetFixedStepSize(float stepSize)
|
||||
{
|
||||
m_stepSize = stepSize;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the renderer of the particles
|
||||
*
|
||||
|
|
@ -448,12 +416,10 @@ namespace Nz
|
|||
m_particleCount = system.m_particleCount;
|
||||
m_particleSize = system.m_particleSize;
|
||||
m_renderer = system.m_renderer;
|
||||
m_stepSize = system.m_stepSize;
|
||||
|
||||
// The copy can not (or should not) happen during the update, there is no use to copy
|
||||
m_dyingParticles.clear();
|
||||
m_processing = false;
|
||||
m_stepAccumulator = 0.f;
|
||||
|
||||
m_buffer.clear(); // To avoid a copy due to resize() which will be pointless
|
||||
ResizeBuffer();
|
||||
|
|
|
|||
Loading…
Reference in New Issue