소스 검색

Merge pull request #5459 from Poolminer/master

pointerDragBahavior: use AbstractMesh instead of Mesh
David Catuhe 6 년 전
부모
커밋
a4d0b74099
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      dist/preview release/what's new.md
  2. 3 3
      src/Behaviors/Mesh/babylon.pointerDragBehavior.ts

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

@@ -84,6 +84,7 @@
 - Fix VR controllers after gltfLoader transformNode change ([TrevorDev](https://github.com/TrevorDev))
 - Bounding Box fixedDragMeshScreenSize stopped working and allow rotating through bounding box ([TrevorDev](https://github.com/TrevorDev))
 - VR helper would rotate non vr camera while in VR ([TrevorDev](https://github.com/TrevorDev))
+- PointerDragBahavior using Mesh as base type, causing type-checking problems with AbstractMesh ([Poolminer](https://github.com/Poolminer/))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

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

@@ -2,9 +2,9 @@ module BABYLON {
     /**
      * A behavior that when attached to a mesh will allow the mesh to be dragged around the screen based on pointer events
      */
-    export class PointerDragBehavior implements Behavior<Mesh> {
+    export class PointerDragBehavior implements Behavior<AbstractMesh> {
         private static _AnyMouseID = -2;
-        private _attachedNode: Mesh;
+        private _attachedNode: AbstractMesh;
         private _dragPlane: Mesh;
         private _scene: Scene;
         private _pointerObserver: Nullable<Observer<PointerInfo>>;
@@ -117,7 +117,7 @@ module BABYLON {
          * Attaches the drag behavior the passed in mesh
          * @param ownerNode The mesh that will be dragged around once attached
          */
-        public attach(ownerNode: Mesh): void {
+        public attach(ownerNode: AbstractMesh): void {
             this._scene = ownerNode.getScene();
             this._attachedNode = ownerNode;