mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:43:36 +02:00
Fixing measure of "old" particles while simplifying the math (faster!).
This commit is contained in:
parent
1eb2f19320
commit
1ed57e044a
1 changed files with 2 additions and 2 deletions
|
@ -483,8 +483,8 @@ void Particle::update(const uint64_t& now) {
|
||||||
float velocityScalar = glm::length(getVelocity());
|
float velocityScalar = glm::length(getVelocity());
|
||||||
const float STILL_MOVING = 0.05f / (float)(TREE_SCALE);
|
const float STILL_MOVING = 0.05f / (float)(TREE_SCALE);
|
||||||
bool isStillMoving = (velocityScalar > STILL_MOVING);
|
bool isStillMoving = (velocityScalar > STILL_MOVING);
|
||||||
const float REALLY_OLD = 30.0f; // 30 seconds
|
const uint64_t REALLY_OLD = 30 * USECS_PER_SECOND; // 30 seconds
|
||||||
bool isReallyOld = ((float)(now - _created) > REALLY_OLD);
|
bool isReallyOld = ((now - _created) > REALLY_OLD);
|
||||||
bool isInHand = getInHand();
|
bool isInHand = getInHand();
|
||||||
bool shouldDie = getShouldDie() || (!isInHand && !isStillMoving && isReallyOld);
|
bool shouldDie = getShouldDie() || (!isInHand && !isStillMoving && isReallyOld);
|
||||||
setShouldDie(shouldDie);
|
setShouldDie(shouldDie);
|
||||||
|
|
Loading…
Reference in a new issue