Browse Source

Merge pull request #5459 from Poolminer/master

pointerDragBahavior: use AbstractMesh instead of Mesh
David Catuhe 6 years ago
parent
commit
a4d0b74099

+ 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;