Fixing measure of "old" particles while simplifying the math (faster!).

This commit is contained in:
Andrew Meadows 2014-01-20 13:40:15 -08:00
parent 1eb2f19320
commit 1ed57e044a

View file

@ -483,8 +483,8 @@ void Particle::update(const uint64_t& now) {
float velocityScalar = glm::length(getVelocity());
const float STILL_MOVING = 0.05f / (float)(TREE_SCALE);
bool isStillMoving = (velocityScalar > STILL_MOVING);
const float REALLY_OLD = 30.0f; // 30 seconds
bool isReallyOld = ((float)(now - _created) > REALLY_OLD);
const uint64_t REALLY_OLD = 30 * USECS_PER_SECOND; // 30 seconds
bool isReallyOld = ((now - _created) > REALLY_OLD);
bool isInHand = getInHand();
bool shouldDie = getShouldDie() || (!isInHand && !isStillMoving && isReallyOld);
setShouldDie(shouldDie);