MCPcopy Create free account
hub / github.com/axmolengine/axmol / simulate

Method simulate

core/2d/ParticleSystem.cpp:1487–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1485}
1486
1487void ParticleSystem::simulate(float seconds, float frameRate)
1488{
1489 seconds = seconds == static_cast<float>(SIMULATION_USE_PARTICLE_LIFETIME) ? getLife() + getLifeVar() : seconds;
1490 frameRate = frameRate == static_cast<float>(SIMULATION_USE_GAME_ANIMATION_INTERVAL)
1491 ? 1.0F / Director::getInstance()->getAnimationInterval()
1492 : frameRate;
1493 auto delta = 1.0F / frameRate;
1494 if (seconds > delta)
1495 {
1496 while (seconds > 0.0F)
1497 {
1498 this->update(delta);
1499 seconds -= delta;
1500 }
1501 this->update(seconds);
1502 }
1503 else
1504 this->update(seconds);
1505}
1506
1507void ParticleSystem::resimulate(float seconds, float frameRate)
1508{

Callers 2

resimulateMethod · 0.95
onEnterMethod · 0.80

Calls 4

updateMethod · 0.95
getLifeFunction · 0.85
getLifeVarFunction · 0.85
getInstanceFunction · 0.85

Tested by 1

onEnterMethod · 0.64