mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-06 14:42:50 +02:00
fix laser lifetimes
This commit is contained in:
parent
341bc3666f
commit
dfe3e5b1cb
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,6 @@ var NULL_ACTION_ID = "{00000000-0000-0000-000000000000}";
|
||||||
var MSEC_PER_SEC = 1000.0;
|
var MSEC_PER_SEC = 1000.0;
|
||||||
|
|
||||||
// these control how long an abandoned pointer line will hang around
|
// these control how long an abandoned pointer line will hang around
|
||||||
var startTime = Date.now();
|
|
||||||
var LIFETIME = 10;
|
var LIFETIME = 10;
|
||||||
var ACTION_LIFETIME = 15; // seconds
|
var ACTION_LIFETIME = 15; // seconds
|
||||||
var ACTION_LIFETIME_REFRESH = 5;
|
var ACTION_LIFETIME_REFRESH = 5;
|
||||||
|
@ -203,11 +202,12 @@ function MyController(hand, triggerAction) {
|
||||||
lifetime: LIFETIME
|
lifetime: LIFETIME
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
var age = Entities.getEntityProperties(this.pointer, "age").age;
|
||||||
Entities.editEntity(this.pointer, {
|
Entities.editEntity(this.pointer, {
|
||||||
position: closePoint,
|
position: closePoint,
|
||||||
linePoints: [ZERO_VEC, farPoint],
|
linePoints: [ZERO_VEC, farPoint],
|
||||||
color: color,
|
color: color,
|
||||||
lifetime: (Date.now() - startTime) / MSEC_PER_SEC + LIFETIME
|
lifetime: age + LIFETIME
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue