浏览代码

ThumbstickValues now stored in a new variable

This prevents the pre-updating of the rightstick values and the "cache" issue that prevents triggering the onThumbstickValuesChanged Observers.

Addressing #7217
Raanan Weber 5 年之前
父节点
当前提交
533ef7bb23
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/Gamepads/Controllers/windowsMotionController.ts

+ 2 - 4
src/Gamepads/Controllers/windowsMotionController.ts

@@ -597,9 +597,7 @@ export class XRWindowsMotionController extends WindowsMotionController {
     /**
     /**
      * holds the thumbstick values (X,Y)
      * holds the thumbstick values (X,Y)
      */
      */
-    public get thumbstickValues(): StickValues {
-        return this.rightStick;
-    }
+    public thumbstickValues: StickValues = { x: 0, y: 0 };
 
 
     /**
     /**
      * Fired when the thumbstick on this controller is clicked
      * Fired when the thumbstick on this controller is clicked
@@ -659,4 +657,4 @@ PoseEnabledControllerHelper._ControllerFactories.push({
     create: (gamepadInfo) => {
     create: (gamepadInfo) => {
         return new WindowsMotionController(gamepadInfo);
         return new WindowsMotionController(gamepadInfo);
     }
     }
-});
+});