22-08-2018, 06:04 PM
(22-08-2018, 04:03 PM)josemendez Wrote: The sleep threshold is expressed in Joules/Kg. So simply check if the kinetic energy of the particles is below the sleep threshold. Pseudocode:
Code:Oni.GetParticleVelocities(solver,velocities,numParticles,startingParticle);
for (int i = 0; i < velocities.Length;++i)
{
if (velocities[i].sqrMagnitude * 0.5f <= solver.parameters.sleepThreshold)
// this one is sleeping.
}
See the last bit of: http://obi.virtualmethodstudio.com/tutor...icles.html for more info on how to use low level particle getter/setters.
Thanks a lot for help. This is exactly what I am looking for.