mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 20:33:09 +02:00
change naming and comment
This commit is contained in:
parent
eb4dee0495
commit
8a0dd55275
1 changed files with 26 additions and 27 deletions
|
@ -40,7 +40,7 @@
|
||||||
if (!AudioDevice.getMuted()) {
|
if (!AudioDevice.getMuted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateTween();
|
updateOverlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
function lerp(a, b, val) {
|
function lerp(a, b, val) {
|
||||||
|
@ -49,10 +49,31 @@
|
||||||
|
|
||||||
function getOffsetPosition() {
|
function getOffsetPosition() {
|
||||||
return Vec3.sum(MyAvatar.getHeadPosition(), Quat.getFront(MyAvatar.headOrientation));
|
return Vec3.sum(MyAvatar.getHeadPosition(), Quat.getFront(MyAvatar.headOrientation));
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTween() {
|
function onMuteToggled() {
|
||||||
// increase the tween value based on speed till it's complete
|
if (AudioDevice.getMuted()) {
|
||||||
|
createOverlay();
|
||||||
|
} else {
|
||||||
|
deleteOverlay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createOverlay() {
|
||||||
|
overlayPosition = getOffsetPosition();
|
||||||
|
overlayID = Overlays.addOverlay("sphere", {
|
||||||
|
position: overlayPosition,
|
||||||
|
rotation: MyAvatar.orientation,
|
||||||
|
alpha: 0.9,
|
||||||
|
dimensions: 0.1,
|
||||||
|
solid: true,
|
||||||
|
ignoreRayIntersection: true,
|
||||||
|
visible: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateOverlay() {
|
||||||
|
// increase by TWEEN_SPEED until completion
|
||||||
if (tweenPosition < 1) {
|
if (tweenPosition < 1) {
|
||||||
tweenPosition += TWEEN_SPEED;
|
tweenPosition += TWEEN_SPEED;
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,28 +107,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMuteToggled() {
|
|
||||||
if (AudioDevice.getMuted()) {
|
|
||||||
createOverlay();
|
|
||||||
} else {
|
|
||||||
deleteOverlay();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createOverlay() {
|
|
||||||
overlayPosition = getOffsetPosition();
|
|
||||||
overlayID = Overlays.addOverlay("sphere", {
|
|
||||||
name: "muteSphere",
|
|
||||||
position: overlayPosition,
|
|
||||||
rotation: MyAvatar.orientation,
|
|
||||||
alpha: 0.9,
|
|
||||||
dimensions: 0.1,
|
|
||||||
solid: true,
|
|
||||||
ignoreRayIntersection: true,
|
|
||||||
visible: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteOverlay() {
|
function deleteOverlay() {
|
||||||
Overlays.deleteOverlay(overlayID);
|
Overlays.deleteOverlay(overlayID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue