فهرست منبع

remove unneeded new and fix priv variable name

Trevor Baron 7 سال پیش
والد
کامیت
f98a8d5b14
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 5 5
      src/Behaviors/Mesh/babylon.pointerDragBehavior.ts
  2. 1 1
      src/babylon.scene.ts

+ 5 - 5
src/Behaviors/Mesh/babylon.pointerDragBehavior.ts

@@ -7,7 +7,7 @@ module BABYLON {
         private _dragPlane: Mesh;
         private _scene:Scene;
         private _pointerObserver:Nullable<Observer<PointerInfo>>;
-        private static planeScene:Scene;
+        private static _planeScene:Scene;
         private _draggingID = -1;
         
         /**
@@ -72,11 +72,11 @@ module BABYLON {
             this._attachedNode = ownerNode;
 
             // Initialize drag plane to not interfere with existing scene
-            if(!PointerDragBehavior.planeScene){
-                PointerDragBehavior.planeScene = new BABYLON.Scene(this._scene.getEngine())
+            if(!PointerDragBehavior._planeScene){
+                PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine())
                 this._scene.getEngine().scenes.pop();
             }
-            this._dragPlane = BABYLON.Mesh.CreatePlane("pointerDragPlane", 1000, PointerDragBehavior.planeScene, false, BABYLON.Mesh.DOUBLESIDE);
+            this._dragPlane = BABYLON.Mesh.CreatePlane("pointerDragPlane", 1000, PointerDragBehavior._planeScene, false, BABYLON.Mesh.DOUBLESIDE);
 
             // State of the drag
             var dragging = false
@@ -132,7 +132,7 @@ module BABYLON {
             if(!ray){
                 return null;
             }
-            var pickResult = PointerDragBehavior.planeScene.pickWithRay(ray, (m)=>{return m == this._dragPlane})
+            var pickResult = PointerDragBehavior._planeScene.pickWithRay(ray, (m)=>{return m == this._dragPlane})
             if (pickResult && pickResult.hit && pickResult.pickedMesh && pickResult.pickedPoint) {
                 return pickResult.pickedPoint;
             }else{

+ 1 - 1
src/babylon.scene.ts

@@ -5751,7 +5751,7 @@
                 return this._cachedRayForTransform;
             }, predicate, fastCheck);
             if(result){
-                result.ray = new Ray(ray.origin, ray.direction);
+                result.ray = ray;
             }
             return result;
         }