MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / reuseParticles

Method reuseParticles

SPlisHSPlasH/EmitterSystem.cpp:34–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void EmitterSystem::reuseParticles()
35{
36 if (m_reuseParticles)
37 {
38 m_reusedParticles.clear();
39 for (unsigned int i = 0; i < m_model->numActiveParticles(); i++)
40 {
41 Vector3r &x = m_model->getPosition(i);
42 if ((x[0] < m_boxMin[0]) || (x[1] < m_boxMin[1]) || (x[2] < m_boxMin[2]) ||
43 (x[0] > m_boxMax[0]) || (x[1] > m_boxMax[1]) || (x[2] > m_boxMax[2]))
44 {
45 m_reusedParticles.push_back(i);
46 m_model->getVelocity(i) *= static_cast<Real>(0.95); // make particles slow so that they don't influence
47 // the CFL condition
48 //model->getPosition(0, i) = Vector3r(1000 + i, 1000, 1000);
49 }
50 }
51 }
52}
53
54void EmitterSystem::step()
55{

Callers

nothing calls this directly

Calls 4

numActiveParticlesMethod · 0.80
getVelocityMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected