فهرست منبع

default left and right non nullable sticks to 0,0

Trevor Baron 7 سال پیش
والد
کامیت
711faccf0e
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      src/Gamepad/babylon.gamepad.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -155,6 +155,7 @@
 - GizmoManager should hide existing gizmos if a non-attachable mesh is selected ([TrevorDev](https://github.com/TrevorDev))
 - Ignore isPickable = false for vr ray casting if the mesh's name matches the specified floorMeshName to maintain backwards compatability ([TrevorDev](https://github.com/TrevorDev))
 - Fix File Loading if hosted from `file:`-Protocol ([ltetzlaff](https://github.com/ltetzlaff))
+- Do not throw error when updating a controller with no left stick ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 

+ 2 - 2
src/Gamepad/babylon.gamepad.ts

@@ -15,8 +15,8 @@
 
         public type: number;
 
-        private _leftStick: StickValues;
-        private _rightStick: StickValues;
+        private _leftStick: StickValues = { x: 0, y: 0 };
+        private _rightStick: StickValues = { x: 0, y: 0 };
 
         /** @hidden */
         public _isConnected = true;