瀏覽代碼

update gizmos to work properly with moving the camera

Trevor Baron 7 年之前
父節點
當前提交
7c5ca7d8f8

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

@@ -98,8 +98,8 @@ module BABYLON {
                     if(!pickInfo.ray){
                         pickInfo.ray = this.options.pointerObservableScene!.createPickingRay(this._scene.pointerX, this._scene.pointerY, Matrix.Identity(), this._scene.activeCamera);
                     }
-                    if(pickInfo.hit){
-                        eventState.skipNextObservers = true;
+                    if(pickInfo.hit && pointerInfoPre.type == BABYLON.PointerEventTypes.POINTERDOWN){
+                        pointerInfoPre.skipOnPointerObservable = true;
                     }
                 }
                 

+ 1 - 1
src/Gizmos/babylon.gizmo.ts

@@ -10,7 +10,7 @@ module BABYLON {
         /**
          * Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
          */
-        public attachedMesh:Nullable<Mesh>;
+        public attachedMesh:Nullable<AbstractMesh>;
         private _beforeRenderObserver:Nullable<Observer<Scene>>;
         /**
          * Creates a gizmo

+ 1 - 1
src/Gizmos/babylon.positionGizmo.ts

@@ -7,7 +7,7 @@ module BABYLON {
         private _yDrag:AxisDragGizmo;
         private _zDrag:AxisDragGizmo;
 
-        public set attachedMesh(mesh:Nullable<Mesh>){
+        public set attachedMesh(mesh:Nullable<AbstractMesh>){
             this._xDrag.attachedMesh = mesh;
             this._yDrag.attachedMesh = mesh;
             this._zDrag.attachedMesh = mesh;

+ 2 - 0
src/Rendering/babylon.utilityLayerRenderer.ts

@@ -36,6 +36,8 @@ module BABYLON {
             this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(()=>{
                 this.dispose();
             })
+            
+            this._updateCamera();
         }
 
         /**