Merge pull request #13258 from wayne-chen/toggleAdvancedMovementFile-case-15453

JavaScript exception in toggleAdvancedMovementForHandControllers.js
This commit is contained in:
Seth Alves 2018-06-01 10:48:24 -07:00 committed by GitHub
commit 708cbbc984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@
var isDisabled = false;
var previousFlyingState = MyAvatar.getFlyingEnabled();
var previousDrivingState = MyAvatar.useAdvancedMovementControls;
var previousDrivingState = false;
function rotate180() {
var newOrientation = Quat.multiply(MyAvatar.orientation, Quat.angleAxis(180, {
@ -100,7 +100,7 @@
Controller.enableMapping(DRIVING_MAPPING_NAME);
}
if (MyAvatar.getFyingEnabled()) {
if (MyAvatar.getFlyingEnabled()) {
Controller.disableMapping(FLYING_MAPPING_NAME);
} else {
Controller.enableMapping(FLYING_MAPPING_NAME);
@ -171,25 +171,4 @@
Messages.subscribe(HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL);
Messages.messageReceived.connect(handleMessage);
function initializeControls() {
if(HMD.active) {
if (Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) {
if (MyAvatar.useAdvancedMovementControls) {
Controller.disableMapping(DRIVING_MAPPING_NAME);
} else {
Controller.enableMapping(DRIVING_MAPPING_NAME);
}
if (MyAvatar.getFlyingEnabled()) {
Controller.disableMapping(FLYING_MAPPING_NAME);
} else {
Controller.enableMapping(FLYING_MAPPING_NAME);
}
});
}
}
initializeControls();
}()); // END LOCAL_SCOPE