mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:44:09 +02:00
Combining three if statements into one!
This commit is contained in:
parent
bfcddcf3b7
commit
1c5923914b
1 changed files with 8 additions and 16 deletions
|
@ -15,9 +15,7 @@
|
||||||
var isRocketing = false;
|
var isRocketing = false;
|
||||||
|
|
||||||
function checkRocketing() {
|
function checkRocketing() {
|
||||||
if (HMD.active) {
|
if (HMD.active && (Controller.Hardware.Vive || Controller.Hardware.OculusTouch) && canRocket()) {
|
||||||
if (Controller.Hardware.Vive || Controller.Hardware.OculusTouch) {
|
|
||||||
if (canRocket()) {
|
|
||||||
isRocketing = true;
|
isRocketing = true;
|
||||||
MyAvatar.motorReferenceFrame = "world";
|
MyAvatar.motorReferenceFrame = "world";
|
||||||
var moveVector = Vec3.multiply(Quat.getFront(Camera.getOrientation()), 10);
|
var moveVector = Vec3.multiply(Quat.getFront(Camera.getOrientation()), 10);
|
||||||
|
@ -29,12 +27,6 @@
|
||||||
} else {
|
} else {
|
||||||
checkCanStopRocketing();
|
checkCanStopRocketing();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
checkCanStopRocketing();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
checkCanStopRocketing();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function checkCanStopRocketing() {
|
function checkCanStopRocketing() {
|
||||||
|
|
Loading…
Reference in a new issue