mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 18:23:22 +02:00
Merge pull request #1662 from ZappoMan/bugfixes
set default particle lifetime to 10 seconds, make sure lifetime is always honored
This commit is contained in:
commit
7e216443e9
3 changed files with 3 additions and 3 deletions
|
@ -135,7 +135,7 @@ function checkControllerSide(whichSide) {
|
|||
inHand: true,
|
||||
radius: 0.05,
|
||||
color: { red: 255, green: 0, blue: 0 },
|
||||
lifetime: 10 // 10 seconds
|
||||
lifetime: 10 // 10 seconds - same as default, not needed but here as an example
|
||||
};
|
||||
|
||||
newParticle = Particles.addParticle(properties);
|
||||
|
|
|
@ -682,7 +682,7 @@ void Particle::update(const uint64_t& now) {
|
|||
const uint64_t REALLY_OLD = 30 * USECS_PER_SECOND; // 30 seconds
|
||||
bool isReallyOld = ((now - _created) > REALLY_OLD);
|
||||
bool isInHand = getInHand();
|
||||
bool shouldDie = getShouldDie() || (!isInHand && isStopped && isReallyOld);
|
||||
bool shouldDie = (getAge() > getLifetime()) || getShouldDie() || (!isInHand && isStopped && isReallyOld);
|
||||
setShouldDie(shouldDie);
|
||||
|
||||
runUpdateScript(); // allow the javascript to alter our state
|
||||
|
|
|
@ -42,7 +42,7 @@ const uint16_t PACKET_CONTAINS_INHAND = 128;
|
|||
const uint16_t PACKET_CONTAINS_SCRIPT = 256;
|
||||
const uint16_t PACKET_CONTAINS_SHOULDDIE = 512;
|
||||
|
||||
const float DEFAULT_LIFETIME = 60.0f * 60.0f * 24.0f; // particles live for 1 day by default
|
||||
const float DEFAULT_LIFETIME = 10.0f; // particles live for 10 seconds by default
|
||||
const float DEFAULT_DAMPING = 0.99f;
|
||||
const float DEFAULT_RADIUS = 0.1f / TREE_SCALE;
|
||||
const float MINIMUM_PARTICLE_ELEMENT_SIZE = (1.0f / 100000.0f) / TREE_SCALE; // smallest size container
|
||||
|
|
Loading…
Reference in a new issue