From 9f20d52d016676b61720616741eec322e6ccc42c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 31 May 2018 15:05:33 -0700 Subject: [PATCH] adding alternate solution. --- ...oggleAdvancedMovementForHandControllers.js | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js index f3dc783af6..92f72f8724 100644 --- a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js +++ b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js @@ -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,24 +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