History

OpenXR cleanup 2, electric boogaloo

Ada committed 1 year ago

Commit 2f340811 parent 87132818 files · +107 −117Browse files

Showing the changes to scripts/system/controllers/toggleAdvancedMovementForHandControllers.js (1 of 8 files). Show all

Unified · Split

scripts/system/controllers/toggleAdvancedMovementForHandControllers.js+9−9
@@ -51,9 +51,7 @@ · 50 unmodified lines
5151 return;
5252 }
5353
54− if (value === 1 && Controller.Hardware.OculusTouch !== undefined) {
55− rotate180();
56− } else if (Controller.Hardware.Vive !== undefined) {
54+ if (Controller.Hardware.Vive !== undefined) {
5755 if (value > 0.75 && inFlipTurn === false) {
5856 inFlipTurn = true;
5957 rotate180();
@@ -61,6 +59,8 @@ · 1 unmodified line
6159 inFlipTurn = false;
6260 }, TURN_RATE);
6361 }
62+ } else {
63+ rotate180();
6464 }
6565 return;
6666 });
@@ -71,9 +71,7 @@ · 4 unmodified lines
7171 return;
7272 }
7373
74− if (value === 1 && Controller.Hardware.OculusTouch !== undefined) {
75− rotate180();
76− } else if (Controller.Hardware.Vive !== undefined) {
74+ if (Controller.Hardware.Vive !== undefined) {
7775 if (value > 0.75 && inFlipTurn === false) {
7876 inFlipTurn = true;
7977 rotate180();
@@ -81,6 +79,8 @@ · 1 unmodified line
8179 inFlipTurn = false;
8280 }, TURN_RATE);
8381 }
82+ } else {
83+ rotate180();
8484 }
8585 return;
8686 });
@@ -96,7 +96,7 @@ · 9 unmodified lines
9696 registerBasicMapping();
9797
9898 Script.setTimeout(function() {
99− if (MyAvatar.useAdvanceMovementControls) {
99+ if (MyAvatar.useAdvancedMovementControls) {
100100 Controller.disableMapping(DRIVING_MAPPING_NAME);
101101 } else {
102102 Controller.enableMapping(DRIVING_MAPPING_NAME);
@@ -112,7 +112,7 @@ · 9 unmodified lines
112112
113113 HMD.displayModeChanged.connect(function(isHMDMode) {
114114 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) {
116116 if (MyAvatar.useAdvancedMovementControls) {
117117 Controller.disableMapping(DRIVING_MAPPING_NAME);
118118 } else {
@@ -131,7 +131,7 @@ · 12 unmodified lines
131131
132132
133133 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) {
135135 var flying = MyAvatar.getFlyingEnabled();
136136 var driving = MyAvatar.useAdvancedMovementControls;
137137