Esempio n. 1
0
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;
	}
}
Esempio n. 2
0
 void WidgetBorder::setTopmost(bool)
 {
     updateVertexArray();
 }
Esempio n. 3
0
 void WidgetBorder::setBorderPadding(int value)
 {
     // TODO: getOrconst Widget & widgetCreateStateSet()->setAttribute(new osg::LineWidth(value));
     updateVertexArray();
 }
Esempio n. 4
0
 void WidgetBorder::setRect(int, int, int, int)
 {
     updateVertexArray();
 }
Esempio n. 5
0
 void WidgetBorder::resize(unsigned int, unsigned int)
 {
     updateVertexArray();
 }
Esempio n. 6
0
 void WidgetBorder::dragWidget(int deltaX, int deltaY)
 {
     updateVertexArray();
 }
Esempio n. 7
0
 void WidgetBorder::setZ(float)
 {
     updateVertexArray();
 }