Showing the changes to scripts/system/controllers/toggleAdvancedMovementForHandControllers.js (1 of 8 files). Show all
Unified · Split
| @@ -51,9 +51,7 @@ · 50 unmodified lines | |||
| 51 | return; | 51 | return; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { | 54 | if (Controller.Hardware.Vive !== undefined) { |
| 55 | rotate180(); | ||
| 56 | } else if (Controller.Hardware.Vive !== undefined) { | ||
| 57 | if (value > 0.75 && inFlipTurn === false) { | 55 | if (value > 0.75 && inFlipTurn === false) { |
| 58 | inFlipTurn = true; | 56 | inFlipTurn = true; |
| 59 | rotate180(); | 57 | rotate180(); |
| @@ -61,6 +59,8 @@ · 1 unmodified line | |||
| 61 | inFlipTurn = false; | 59 | inFlipTurn = false; |
| 62 | }, TURN_RATE); | 60 | }, TURN_RATE); |
| 63 | } | 61 | } |
| 62 | } else { | ||
| 63 | rotate180(); | ||
| 64 | } | 64 | } |
| 65 | return; | 65 | return; |
| 66 | }); | 66 | }); |
| @@ -71,9 +71,7 @@ · 4 unmodified lines | |||
| 71 | return; | 71 | return; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { | 74 | if (Controller.Hardware.Vive !== undefined) { |
| 75 | rotate180(); | ||
| 76 | } else if (Controller.Hardware.Vive !== undefined) { | ||
| 77 | if (value > 0.75 && inFlipTurn === false) { | 75 | if (value > 0.75 && inFlipTurn === false) { |
| 78 | inFlipTurn = true; | 76 | inFlipTurn = true; |
| 79 | rotate180(); | 77 | rotate180(); |
| @@ -81,6 +79,8 @@ · 1 unmodified line | |||
| 81 | inFlipTurn = false; | 79 | inFlipTurn = false; |
| 82 | }, TURN_RATE); | 80 | }, TURN_RATE); |
| 83 | } | 81 | } |
| 82 | } else { | ||
| 83 | rotate180(); | ||
| 84 | } | 84 | } |
| 85 | return; | 85 | return; |
| 86 | }); | 86 | }); |
| @@ -96,7 +96,7 @@ · 9 unmodified lines | |||
| 96 | registerBasicMapping(); | 96 | registerBasicMapping(); |
| 97 | 97 | ||
| 98 | Script.setTimeout(function() { | 98 | Script.setTimeout(function() { |
| 99 | if (MyAvatar.useAdvanceMovementControls) { | 99 | if (MyAvatar.useAdvancedMovementControls) { |
| 100 | Controller.disableMapping(DRIVING_MAPPING_NAME); | 100 | Controller.disableMapping(DRIVING_MAPPING_NAME); |
| 101 | } else { | 101 | } else { |
| 102 | Controller.enableMapping(DRIVING_MAPPING_NAME); | 102 | Controller.enableMapping(DRIVING_MAPPING_NAME); |
| @@ -112,7 +112,7 @@ · 9 unmodified lines | |||
| 112 | 112 | ||
| 113 | HMD.displayModeChanged.connect(function(isHMDMode) { | 113 | HMD.displayModeChanged.connect(function(isHMDMode) { |
| 114 | if (isHMDMode) { | 114 | if (isHMDMode) { |
| 115 | if (Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) { | 115 | if (Controller.Hardware.OpenXR !== undefined || Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) { |
| 116 | if (MyAvatar.useAdvancedMovementControls) { | 116 | if (MyAvatar.useAdvancedMovementControls) { |
| 117 | Controller.disableMapping(DRIVING_MAPPING_NAME); | 117 | Controller.disableMapping(DRIVING_MAPPING_NAME); |
| 118 | } else { | 118 | } else { |
| @@ -131,7 +131,7 @@ · 12 unmodified lines | |||
| 131 | 131 | ||
| 132 | 132 | ||
| 133 | function update() { | 133 | function update() { |
| 134 | if ((Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) && HMD.active) { | 134 | if ((Controller.Hardware.OpenXR !== undefined || Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) && HMD.active) { |
| 135 | var flying = MyAvatar.getFlyingEnabled(); | 135 | var flying = MyAvatar.getFlyingEnabled(); |
| 136 | var driving = MyAvatar.useAdvancedMovementControls; | 136 | var driving = MyAvatar.useAdvancedMovementControls; |
| 137 | 137 | ||