void ParticleBatch2D::update(float deltaTime) { for (int i = 0; i < m_maxParticles; i++) { if (m_particles[i].lifeTime > 0.0f) { m_updateFunc(m_particles[i], deltaTime); m_particles[i].lifeTime -= m_decayRate * deltaTime; } } }
void ParticalBatch2D::update(float deltaTime) { for (int i{ 0 }; i < m_maxParticals; ++i) { auto& partical = m_particals[i]; if (partical.life > 0.0f) { m_updateFunc(partical, deltaTime); partical.life -= m_decayRate * deltaTime; } } }
void ParticleBatch2D::update(float deltaTime) { for (int i = 0; i < m_maxParticles; i++) { // Check if it is active if (m_particles[i].m_life > 0.0f) { m_updateFunc(m_particles[i], deltaTime); m_particles[i].m_life -= m_decayRate * deltaTime; } } }
void ParticleBatch::update(float deltaTime) { for (int i = 0; i < m_maxParticles; i++) { // Check if it is active if (m_particles[i].lifeTime > 0.0f) { // Update using function pointer m_updateFunc(m_particles[i], deltaTime); m_particles[i].lifeTime -= m_decayRate * deltaTime; } } }
void ParticleBatch2D::Update(float _deltaTime) { auto pointerToArray = m_particles.get(); for (int i = 0; i < m_maxParticles; i++) { // check if it is active if (pointerToArray[i].m_life > 0.0f) { // Update using function pointer m_updateFunc(pointerToArray[i], _deltaTime); pointerToArray[i].m_life -= m_decayRate * _deltaTime; } } }