Pārlūkot izejas kodu

fixed getControllerByName

David Catuhe 8 gadi atpakaļ
vecāks
revīzija
566f091fb6

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2516 - 2515
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 11 - 11
dist/preview release/babylon.js


+ 25 - 10
dist/preview release/babylon.max.js

@@ -46080,6 +46080,13 @@ var BABYLON;
         PoseEnabledController.prototype.detachMesh = function () {
             this._mesh = undefined;
         };
+        Object.defineProperty(PoseEnabledController.prototype, "mesh", {
+            get: function () {
+                return this._mesh;
+            },
+            enumerable: true,
+            configurable: true
+        });
         return PoseEnabledController;
     }(BABYLON.Gamepad));
     BABYLON.PoseEnabledController = PoseEnabledController;
@@ -58991,13 +58998,13 @@ var BABYLON;
             configurable: true
         });
         WebVRFreeCamera.prototype.getControllerByName = function (name) {
-            var controller;
-            this.controllers.forEach(function (gp) {
+            for (var _i = 0, _a = this.controllers; _i < _a.length; _i++) {
+                var gp = _a[_i];
                 if (gp.hand === name) {
                     return gp;
                 }
-            });
-            return controller;
+            }
+            return undefined;
         };
         Object.defineProperty(WebVRFreeCamera.prototype, "leftController", {
             get: function () {
@@ -59021,12 +59028,20 @@ var BABYLON;
             configurable: true
         });
         ;
-        WebVRFreeCamera.prototype.getLeftCamera = function () {
-            return this._rigCameras[0];
-        };
-        WebVRFreeCamera.prototype.getRightCamera = function () {
-            return this._rigCameras[1];
-        };
+        Object.defineProperty(WebVRFreeCamera.prototype, "leftCamera", {
+            get: function () {
+                return this._rigCameras[0];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(WebVRFreeCamera.prototype, "rightCamera", {
+            get: function () {
+                return this._rigCameras[1];
+            },
+            enumerable: true,
+            configurable: true
+        });
         WebVRFreeCamera.prototype.getLeftTarget = function () {
             return this._rigCameras[0].getTarget();
         };

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2516 - 2515
dist/preview release/babylon.module.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 11 - 11
dist/preview release/babylon.worker.js


+ 5 - 7
src/Cameras/VR/babylon.webVRCamera.ts

@@ -187,15 +187,13 @@ module BABYLON {
         }
 
         public getControllerByName(name: string): WebVRController {
-            var controller: WebVRController;
-
-            this.controllers.forEach(gp => {
+            for (var gp of this.controllers) {
                 if (gp.hand === name) {
                     return gp;
                 }
-            })
+            }
 
-            return controller;
+            return undefined;
         }
 
         private _leftController: WebVRController;
@@ -216,11 +214,11 @@ module BABYLON {
             return this._rightController;
         };
 
-        public getLeftCamera() {
+        public get leftCamera():FreeCamera {
             return (<FreeCamera>this._rigCameras[0]);
         }
 
-        public getRightCamera() {
+        public get rightCamera():FreeCamera {
             return (<FreeCamera>this._rigCameras[1]);
         }
 

+ 4 - 0
src/Tools/babylon.extendedGamepad.ts

@@ -121,6 +121,10 @@ module BABYLON {
         public detachMesh() {
             this._mesh = undefined;
         }
+
+        public get mesh(): AbstractMesh {
+            return this._mesh;
+        }
     }
 
     export interface GamepadButtonChanges {