void ParticleSystem::update(sf::Time dt)
{
	for (auto& particle : mParticles)
	{
		particle.lifeTime -= dt;
	}

	// Particles will be order by increasing lifetime, so pop until lifetime > 0
	while (!mParticles.empty() && mParticles.front().lifeTime <= sf::seconds(0.f))
	{
		mParticles.pop_front();
		mVertexNeedsUpdate = true;
	}

	// If this is a moving particle system, the vertex needs to constantly update
	// due to moving particles
	if (mType != Particle::Trail)
	{
		applyEffects(dt);
		mVertexNeedsUpdate = true;
	}

	if (mVertexNeedsUpdate)
	{
		updateVertexArray();
		mVertexNeedsUpdate = false;
	}
}
Example #2
0
 void WidgetBorder::setTopmost(bool)
 {
     updateVertexArray();
 }
Example #3
0
 void WidgetBorder::setBorderPadding(int value)
 {
     // TODO: getOrconst Widget & widgetCreateStateSet()->setAttribute(new osg::LineWidth(value));
     updateVertexArray();
 }
Example #4
0
 void WidgetBorder::setRect(int, int, int, int)
 {
     updateVertexArray();
 }
Example #5
0
 void WidgetBorder::resize(unsigned int, unsigned int)
 {
     updateVertexArray();
 }
Example #6
0
 void WidgetBorder::dragWidget(int deltaX, int deltaY)
 {
     updateVertexArray();
 }
Example #7
0
 void WidgetBorder::setZ(float)
 {
     updateVertexArray();
 }