Exemplo n.º 1
0
	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;
			}
		}
	}
Exemplo n.º 2
0
	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;
			}
		}
	}
Exemplo n.º 3
0
    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;
            }
        }
    }
Exemplo n.º 4
0
	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;
     }
   }
 }