mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 11:19:54 +02:00
Fix flash of color from laser target when turn on or jump distance
This commit is contained in:
parent
a74678a24d
commit
47ab9d3221
1 changed files with 6 additions and 1 deletions
|
@ -44,6 +44,7 @@ Laser = function (side) {
|
|||
|
||||
laserLength,
|
||||
specifiedLaserLength = null,
|
||||
laserSphereSize = 0,
|
||||
|
||||
LEFT_HAND = 0,
|
||||
|
||||
|
@ -132,12 +133,16 @@ Laser = function (side) {
|
|||
} else {
|
||||
Overlays.editOverlay(laserLine, { visible: false });
|
||||
}
|
||||
updateSphere(searchTarget, sphereSize, color, brightColor);
|
||||
// Avoid flash from large laser sphere when turn on or suddenly increase distance. Rendering seems to update overlay
|
||||
// position one frame behind so use sphere size from preceding frame.
|
||||
updateSphere(searchTarget, laserSphereSize, color, brightColor);
|
||||
laserSphereSize = sphereSize;
|
||||
}
|
||||
|
||||
function hide() {
|
||||
Overlays.editOverlay(laserLine, { visible: false });
|
||||
Overlays.editOverlay(laserSphere, { visible: false });
|
||||
laserSphereSize = 0;
|
||||
}
|
||||
|
||||
function setUIOverlays(overlayIDs) {
|
||||
|
|
Loading…
Reference in a new issue