فهرست منبع

Bug fix - when the gamepad is disconnected

When the actual gamepad is disconnected, the gamepad object will still
exist. Now the leftStick value is being tested, which ensures that the
values are provided.
checking for browserGamepad might also be valid, but the browser might
leave the object as well.
Raanan Weber 8 سال پیش
والد
کامیت
27d3357612
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/Cameras/Inputs/babylon.freecamera.input.gamepad.ts

+ 1 - 1
src/Cameras/Inputs/babylon.freecamera.input.gamepad.ts

@@ -29,7 +29,7 @@ module BABYLON {
         }
 
         checkInputs() {
-            if (this.gamepad) {
+            if (this.gamepad && this.gamepad.leftStick) {
                 var camera = this.camera;
                 var LSValues = this.gamepad.leftStick;
                 var normalizedLX = LSValues.x / this.gamepadMoveSensibility;