Browse Source

GUI: Added support for pointer move events on projected UI

David Catuhe 8 years ago
parent
commit
6c8f2434f2

+ 129 - 128
dist/preview release/babylon.d.ts

@@ -3806,134 +3806,6 @@ declare module BABYLON {
     }
     }
 }
 }
 
 
-declare module BABYLON.Debug {
-    class AxesViewer {
-        private _xline;
-        private _yline;
-        private _zline;
-        private _xmesh;
-        private _ymesh;
-        private _zmesh;
-        scene: Scene;
-        scaleLines: number;
-        constructor(scene: Scene, scaleLines?: number);
-        update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    class BoneAxesViewer extends Debug.AxesViewer {
-        mesh: Mesh;
-        bone: Bone;
-        pos: Vector3;
-        xaxis: Vector3;
-        yaxis: Vector3;
-        zaxis: Vector3;
-        constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
-        update(): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
-    class DebugLayer {
-        private _scene;
-        static InspectorURL: string;
-        private _inspector;
-        constructor(scene: Scene);
-        /** Creates the inspector window. */
-        private _createInspector(config?);
-        isVisible(): boolean;
-        hide(): void;
-        show(config?: {
-            popup?: boolean;
-            initialTab?: number;
-            parentElement?: HTMLElement;
-            newColors?: {
-                backgroundColor?: string;
-                backgroundColorLighter?: string;
-                backgroundColorLighter2?: string;
-                backgroundColorLighter3?: string;
-                color?: string;
-                colorTop?: string;
-                colorBot?: string;
-            };
-        }): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    class PhysicsViewer {
-        protected _impostors: Array<PhysicsImpostor>;
-        protected _meshes: Array<AbstractMesh>;
-        protected _scene: Scene;
-        protected _numMeshes: number;
-        protected _physicsEnginePlugin: IPhysicsEnginePlugin;
-        private _renderFunction;
-        private _debugBoxMesh;
-        private _debugSphereMesh;
-        private _debugMaterial;
-        constructor(scene: Scene);
-        protected _updateDebugMeshes(): void;
-        showImpostor(impostor: PhysicsImpostor): void;
-        hideImpostor(impostor: PhysicsImpostor): void;
-        private _getDebugMaterial(scene);
-        private _getDebugBoxMesh(scene);
-        private _getDebugSphereMesh(scene);
-        private _getDebugMesh(impostor, scene);
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
-    class RayHelper {
-        ray: Ray;
-        private _renderPoints;
-        private _renderLine;
-        private _renderFunction;
-        private _scene;
-        private _updateToMeshFunction;
-        private _attachedToMesh;
-        private _meshSpaceDirection;
-        private _meshSpaceOrigin;
-        static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
-        constructor(ray: Ray);
-        show(scene: Scene, color: Color3): void;
-        hide(): void;
-        private _render();
-        attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
-        detachFromMesh(): void;
-        private _updateToMesh();
-        dispose(): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    /**
-    * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
-    */
-    class SkeletonViewer {
-        skeleton: Skeleton;
-        mesh: AbstractMesh;
-        autoUpdateBonesMatrices: boolean;
-        renderingGroupId: number;
-        color: Color3;
-        private _scene;
-        private _debugLines;
-        private _debugMesh;
-        private _isEnabled;
-        private _renderFunction;
-        constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
-        isEnabled: boolean;
-        private _getBonePosition(position, bone, meshMat, x?, y?, z?);
-        private _getLinesForBonesWithLength(bones, meshMat);
-        private _getLinesForBonesNoLength(bones, meshMat);
-        update(): void;
-        dispose(): void;
-    }
-}
-
 declare module BABYLON {
 declare module BABYLON {
     class Collider {
     class Collider {
         radius: Vector3;
         radius: Vector3;
@@ -4592,6 +4464,134 @@ declare module BABYLON {
     }
     }
 }
 }
 
 
+declare module BABYLON.Debug {
+    class AxesViewer {
+        private _xline;
+        private _yline;
+        private _zline;
+        private _xmesh;
+        private _ymesh;
+        private _zmesh;
+        scene: Scene;
+        scaleLines: number;
+        constructor(scene: Scene, scaleLines?: number);
+        update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    class BoneAxesViewer extends Debug.AxesViewer {
+        mesh: Mesh;
+        bone: Bone;
+        pos: Vector3;
+        xaxis: Vector3;
+        yaxis: Vector3;
+        zaxis: Vector3;
+        constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
+        update(): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
+    class DebugLayer {
+        private _scene;
+        static InspectorURL: string;
+        private _inspector;
+        constructor(scene: Scene);
+        /** Creates the inspector window. */
+        private _createInspector(config?);
+        isVisible(): boolean;
+        hide(): void;
+        show(config?: {
+            popup?: boolean;
+            initialTab?: number;
+            parentElement?: HTMLElement;
+            newColors?: {
+                backgroundColor?: string;
+                backgroundColorLighter?: string;
+                backgroundColorLighter2?: string;
+                backgroundColorLighter3?: string;
+                color?: string;
+                colorTop?: string;
+                colorBot?: string;
+            };
+        }): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    class PhysicsViewer {
+        protected _impostors: Array<PhysicsImpostor>;
+        protected _meshes: Array<AbstractMesh>;
+        protected _scene: Scene;
+        protected _numMeshes: number;
+        protected _physicsEnginePlugin: IPhysicsEnginePlugin;
+        private _renderFunction;
+        private _debugBoxMesh;
+        private _debugSphereMesh;
+        private _debugMaterial;
+        constructor(scene: Scene);
+        protected _updateDebugMeshes(): void;
+        showImpostor(impostor: PhysicsImpostor): void;
+        hideImpostor(impostor: PhysicsImpostor): void;
+        private _getDebugMaterial(scene);
+        private _getDebugBoxMesh(scene);
+        private _getDebugSphereMesh(scene);
+        private _getDebugMesh(impostor, scene);
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
+    class RayHelper {
+        ray: Ray;
+        private _renderPoints;
+        private _renderLine;
+        private _renderFunction;
+        private _scene;
+        private _updateToMeshFunction;
+        private _attachedToMesh;
+        private _meshSpaceDirection;
+        private _meshSpaceOrigin;
+        static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
+        constructor(ray: Ray);
+        show(scene: Scene, color: Color3): void;
+        hide(): void;
+        private _render();
+        attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
+        detachFromMesh(): void;
+        private _updateToMesh();
+        dispose(): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    /**
+    * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
+    */
+    class SkeletonViewer {
+        skeleton: Skeleton;
+        mesh: AbstractMesh;
+        autoUpdateBonesMatrices: boolean;
+        renderingGroupId: number;
+        color: Color3;
+        private _scene;
+        private _debugLines;
+        private _debugMesh;
+        private _isEnabled;
+        private _renderFunction;
+        constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
+        isEnabled: boolean;
+        private _getBonePosition(position, bone, meshMat, x?, y?, z?);
+        private _getLinesForBonesWithLength(bones, meshMat);
+        private _getLinesForBonesNoLength(bones, meshMat);
+        update(): void;
+        dispose(): void;
+    }
+}
+
 declare module BABYLON {
 declare module BABYLON {
     interface ILoadingScreen {
     interface ILoadingScreen {
         displayLoadingUI: () => void;
         displayLoadingUI: () => void;
@@ -8740,6 +8740,7 @@ declare module BABYLON {
         showBoundingBox: boolean;
         showBoundingBox: boolean;
         showSubMeshesBoundingBox: boolean;
         showSubMeshesBoundingBox: boolean;
         isBlocker: boolean;
         isBlocker: boolean;
+        enablePointerMoveEvents: boolean;
         renderingGroupId: number;
         renderingGroupId: number;
         private _material;
         private _material;
         material: Material;
         material: Material;

File diff suppressed because it is too large
+ 11 - 11
dist/preview release/babylon.js


+ 2 - 1
dist/preview release/babylon.max.js

@@ -11445,6 +11445,7 @@ var BABYLON;
             _this.showBoundingBox = false;
             _this.showBoundingBox = false;
             _this.showSubMeshesBoundingBox = false;
             _this.showSubMeshesBoundingBox = false;
             _this.isBlocker = false;
             _this.isBlocker = false;
+            _this.enablePointerMoveEvents = false;
             _this.renderingGroupId = 0;
             _this.renderingGroupId = 0;
             _this._receiveShadows = false;
             _this._receiveShadows = false;
             _this.renderOutline = false;
             _this.renderOutline = false;
@@ -16520,7 +16521,7 @@ var BABYLON;
                 }
                 }
                 var canvas = _this._engine.getRenderingCanvas();
                 var canvas = _this._engine.getRenderingCanvas();
                 if (!_this.pointerMovePredicate) {
                 if (!_this.pointerMovePredicate) {
-                    _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (_this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined)); };
+                    _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (mesh.enablePointerMoveEvents || _this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined)); };
                 }
                 }
                 // Meshes
                 // Meshes
                 var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers);
                 var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers);

+ 129 - 128
dist/preview release/babylon.module.d.ts

@@ -3806,134 +3806,6 @@ declare module BABYLON {
     }
     }
 }
 }
 
 
-declare module BABYLON.Debug {
-    class AxesViewer {
-        private _xline;
-        private _yline;
-        private _zline;
-        private _xmesh;
-        private _ymesh;
-        private _zmesh;
-        scene: Scene;
-        scaleLines: number;
-        constructor(scene: Scene, scaleLines?: number);
-        update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    class BoneAxesViewer extends Debug.AxesViewer {
-        mesh: Mesh;
-        bone: Bone;
-        pos: Vector3;
-        xaxis: Vector3;
-        yaxis: Vector3;
-        zaxis: Vector3;
-        constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
-        update(): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
-    class DebugLayer {
-        private _scene;
-        static InspectorURL: string;
-        private _inspector;
-        constructor(scene: Scene);
-        /** Creates the inspector window. */
-        private _createInspector(config?);
-        isVisible(): boolean;
-        hide(): void;
-        show(config?: {
-            popup?: boolean;
-            initialTab?: number;
-            parentElement?: HTMLElement;
-            newColors?: {
-                backgroundColor?: string;
-                backgroundColorLighter?: string;
-                backgroundColorLighter2?: string;
-                backgroundColorLighter3?: string;
-                color?: string;
-                colorTop?: string;
-                colorBot?: string;
-            };
-        }): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    class PhysicsViewer {
-        protected _impostors: Array<PhysicsImpostor>;
-        protected _meshes: Array<AbstractMesh>;
-        protected _scene: Scene;
-        protected _numMeshes: number;
-        protected _physicsEnginePlugin: IPhysicsEnginePlugin;
-        private _renderFunction;
-        private _debugBoxMesh;
-        private _debugSphereMesh;
-        private _debugMaterial;
-        constructor(scene: Scene);
-        protected _updateDebugMeshes(): void;
-        showImpostor(impostor: PhysicsImpostor): void;
-        hideImpostor(impostor: PhysicsImpostor): void;
-        private _getDebugMaterial(scene);
-        private _getDebugBoxMesh(scene);
-        private _getDebugSphereMesh(scene);
-        private _getDebugMesh(impostor, scene);
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
-    class RayHelper {
-        ray: Ray;
-        private _renderPoints;
-        private _renderLine;
-        private _renderFunction;
-        private _scene;
-        private _updateToMeshFunction;
-        private _attachedToMesh;
-        private _meshSpaceDirection;
-        private _meshSpaceOrigin;
-        static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
-        constructor(ray: Ray);
-        show(scene: Scene, color: Color3): void;
-        hide(): void;
-        private _render();
-        attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
-        detachFromMesh(): void;
-        private _updateToMesh();
-        dispose(): void;
-    }
-}
-
-declare module BABYLON.Debug {
-    /**
-    * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
-    */
-    class SkeletonViewer {
-        skeleton: Skeleton;
-        mesh: AbstractMesh;
-        autoUpdateBonesMatrices: boolean;
-        renderingGroupId: number;
-        color: Color3;
-        private _scene;
-        private _debugLines;
-        private _debugMesh;
-        private _isEnabled;
-        private _renderFunction;
-        constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
-        isEnabled: boolean;
-        private _getBonePosition(position, bone, meshMat, x?, y?, z?);
-        private _getLinesForBonesWithLength(bones, meshMat);
-        private _getLinesForBonesNoLength(bones, meshMat);
-        update(): void;
-        dispose(): void;
-    }
-}
-
 declare module BABYLON {
 declare module BABYLON {
     class Collider {
     class Collider {
         radius: Vector3;
         radius: Vector3;
@@ -4592,6 +4464,134 @@ declare module BABYLON {
     }
     }
 }
 }
 
 
+declare module BABYLON.Debug {
+    class AxesViewer {
+        private _xline;
+        private _yline;
+        private _zline;
+        private _xmesh;
+        private _ymesh;
+        private _zmesh;
+        scene: Scene;
+        scaleLines: number;
+        constructor(scene: Scene, scaleLines?: number);
+        update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    class BoneAxesViewer extends Debug.AxesViewer {
+        mesh: Mesh;
+        bone: Bone;
+        pos: Vector3;
+        xaxis: Vector3;
+        yaxis: Vector3;
+        zaxis: Vector3;
+        constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
+        update(): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
+    class DebugLayer {
+        private _scene;
+        static InspectorURL: string;
+        private _inspector;
+        constructor(scene: Scene);
+        /** Creates the inspector window. */
+        private _createInspector(config?);
+        isVisible(): boolean;
+        hide(): void;
+        show(config?: {
+            popup?: boolean;
+            initialTab?: number;
+            parentElement?: HTMLElement;
+            newColors?: {
+                backgroundColor?: string;
+                backgroundColorLighter?: string;
+                backgroundColorLighter2?: string;
+                backgroundColorLighter3?: string;
+                color?: string;
+                colorTop?: string;
+                colorBot?: string;
+            };
+        }): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    class PhysicsViewer {
+        protected _impostors: Array<PhysicsImpostor>;
+        protected _meshes: Array<AbstractMesh>;
+        protected _scene: Scene;
+        protected _numMeshes: number;
+        protected _physicsEnginePlugin: IPhysicsEnginePlugin;
+        private _renderFunction;
+        private _debugBoxMesh;
+        private _debugSphereMesh;
+        private _debugMaterial;
+        constructor(scene: Scene);
+        protected _updateDebugMeshes(): void;
+        showImpostor(impostor: PhysicsImpostor): void;
+        hideImpostor(impostor: PhysicsImpostor): void;
+        private _getDebugMaterial(scene);
+        private _getDebugBoxMesh(scene);
+        private _getDebugSphereMesh(scene);
+        private _getDebugMesh(impostor, scene);
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
+    class RayHelper {
+        ray: Ray;
+        private _renderPoints;
+        private _renderLine;
+        private _renderFunction;
+        private _scene;
+        private _updateToMeshFunction;
+        private _attachedToMesh;
+        private _meshSpaceDirection;
+        private _meshSpaceOrigin;
+        static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
+        constructor(ray: Ray);
+        show(scene: Scene, color: Color3): void;
+        hide(): void;
+        private _render();
+        attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
+        detachFromMesh(): void;
+        private _updateToMesh();
+        dispose(): void;
+    }
+}
+
+declare module BABYLON.Debug {
+    /**
+    * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
+    */
+    class SkeletonViewer {
+        skeleton: Skeleton;
+        mesh: AbstractMesh;
+        autoUpdateBonesMatrices: boolean;
+        renderingGroupId: number;
+        color: Color3;
+        private _scene;
+        private _debugLines;
+        private _debugMesh;
+        private _isEnabled;
+        private _renderFunction;
+        constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
+        isEnabled: boolean;
+        private _getBonePosition(position, bone, meshMat, x?, y?, z?);
+        private _getLinesForBonesWithLength(bones, meshMat);
+        private _getLinesForBonesNoLength(bones, meshMat);
+        update(): void;
+        dispose(): void;
+    }
+}
+
 declare module BABYLON {
 declare module BABYLON {
     interface ILoadingScreen {
     interface ILoadingScreen {
         displayLoadingUI: () => void;
         displayLoadingUI: () => void;
@@ -8740,6 +8740,7 @@ declare module BABYLON {
         showBoundingBox: boolean;
         showBoundingBox: boolean;
         showSubMeshesBoundingBox: boolean;
         showSubMeshesBoundingBox: boolean;
         isBlocker: boolean;
         isBlocker: boolean;
+        enablePointerMoveEvents: boolean;
         renderingGroupId: number;
         renderingGroupId: number;
         private _material;
         private _material;
         material: Material;
         material: Material;

File diff suppressed because it is too large
+ 11 - 11
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 3607 - 3606
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff suppressed because it is too large
+ 21 - 21
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 2 - 1
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -11445,6 +11445,7 @@ var BABYLON;
             _this.showBoundingBox = false;
             _this.showBoundingBox = false;
             _this.showSubMeshesBoundingBox = false;
             _this.showSubMeshesBoundingBox = false;
             _this.isBlocker = false;
             _this.isBlocker = false;
+            _this.enablePointerMoveEvents = false;
             _this.renderingGroupId = 0;
             _this.renderingGroupId = 0;
             _this._receiveShadows = false;
             _this._receiveShadows = false;
             _this.renderOutline = false;
             _this.renderOutline = false;
@@ -16520,7 +16521,7 @@ var BABYLON;
                 }
                 }
                 var canvas = _this._engine.getRenderingCanvas();
                 var canvas = _this._engine.getRenderingCanvas();
                 if (!_this.pointerMovePredicate) {
                 if (!_this.pointerMovePredicate) {
-                    _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (_this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined)); };
+                    _this.pointerMovePredicate = function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (mesh.enablePointerMoveEvents || _this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined)); };
                 }
                 }
                 // Meshes
                 // Meshes
                 var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers);
                 var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this.pointerMovePredicate, false, _this.cameraToUseForPointers);

File diff suppressed because it is too large
+ 3607 - 3606
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 3 - 3
dist/preview release/gui/babylon.gui.d.ts

@@ -37,7 +37,7 @@ declare module BABYLON.GUI {
         private _render();
         private _render();
         private _doPicking(x, y, type);
         private _doPicking(x, y, type);
         attach(): void;
         attach(): void;
-        attachToMesh(mesh: AbstractMesh): void;
+        attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
         private _attachToOnBlur(scene);
         private _attachToOnBlur(scene);
         static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number): AdvancedDynamicTexture;
         static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number): AdvancedDynamicTexture;
         static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Scene): AdvancedDynamicTexture;
         static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Scene): AdvancedDynamicTexture;
@@ -239,7 +239,7 @@ declare module BABYLON.GUI {
         _processPicking(x: number, y: number, type: number): boolean;
         _processPicking(x: number, y: number, type: number): boolean;
         protected _onPointerMove(coordinates: Vector2): void;
         protected _onPointerMove(coordinates: Vector2): void;
         protected _onPointerEnter(): boolean;
         protected _onPointerEnter(): boolean;
-        protected _onPointerOut(): void;
+        _onPointerOut(): void;
         protected _onPointerDown(coordinates: Vector2): boolean;
         protected _onPointerDown(coordinates: Vector2): boolean;
         protected _onPointerUp(coordinates: Vector2): void;
         protected _onPointerUp(coordinates: Vector2): void;
         forcePointerUp(): void;
         forcePointerUp(): void;
@@ -529,7 +529,7 @@ declare module BABYLON.GUI {
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         _processPicking(x: number, y: number, type: number): boolean;
         _processPicking(x: number, y: number, type: number): boolean;
         protected _onPointerEnter(): boolean;
         protected _onPointerEnter(): boolean;
-        protected _onPointerOut(): void;
+        _onPointerOut(): void;
         protected _onPointerDown(coordinates: Vector2): boolean;
         protected _onPointerDown(coordinates: Vector2): boolean;
         protected _onPointerUp(coordinates: Vector2): void;
         protected _onPointerUp(coordinates: Vector2): void;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;

+ 16 - 6
dist/preview release/gui/babylon.gui.js

@@ -247,8 +247,8 @@ var BABYLON;
                 }
                 }
                 if (!this._rootContainer._processPicking(x, y, type)) {
                 if (!this._rootContainer._processPicking(x, y, type)) {
                     if (type === BABYLON.PointerEventTypes.POINTERMOVE) {
                     if (type === BABYLON.PointerEventTypes.POINTERMOVE) {
-                        if (this._lastControlOver && this._lastControlOver.onPointerOutObservable.hasObservers()) {
-                            this._lastControlOver.onPointerOutObservable.notifyObservers(this._lastControlOver);
+                        if (this._lastControlOver) {
+                            this._lastControlOver._onPointerOut();
                         }
                         }
                         this._lastControlOver = null;
                         this._lastControlOver = null;
                     }
                     }
@@ -269,11 +269,14 @@ var BABYLON;
                 });
                 });
                 this._attachToOnBlur(scene);
                 this._attachToOnBlur(scene);
             };
             };
-            AdvancedDynamicTexture.prototype.attachToMesh = function (mesh) {
+            AdvancedDynamicTexture.prototype.attachToMesh = function (mesh, supportPointerMove) {
                 var _this = this;
                 var _this = this;
+                if (supportPointerMove === void 0) { supportPointerMove = true; }
                 var scene = this.getScene();
                 var scene = this.getScene();
                 this._pointerObserver = scene.onPointerObservable.add(function (pi, state) {
                 this._pointerObserver = scene.onPointerObservable.add(function (pi, state) {
-                    if (pi.type !== BABYLON.PointerEventTypes.POINTERUP && pi.type !== BABYLON.PointerEventTypes.POINTERDOWN) {
+                    if (pi.type !== BABYLON.PointerEventTypes.POINTERMOVE
+                        && pi.type !== BABYLON.PointerEventTypes.POINTERUP
+                        && pi.type !== BABYLON.PointerEventTypes.POINTERDOWN) {
                         return;
                         return;
                     }
                     }
                     if (pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {
                     if (pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {
@@ -287,14 +290,21 @@ var BABYLON;
                         }
                         }
                         _this._lastControlDown = null;
                         _this._lastControlDown = null;
                     }
                     }
+                    else if (pi.type === BABYLON.PointerEventTypes.POINTERMOVE) {
+                        if (_this._lastControlOver) {
+                            _this._lastControlOver._onPointerOut();
+                        }
+                        _this._lastControlOver = null;
+                    }
                 });
                 });
+                mesh.enablePointerMoveEvents = supportPointerMove;
                 this._attachToOnBlur(scene);
                 this._attachToOnBlur(scene);
             };
             };
             AdvancedDynamicTexture.prototype._attachToOnBlur = function (scene) {
             AdvancedDynamicTexture.prototype._attachToOnBlur = function (scene) {
                 var _this = this;
                 var _this = this;
                 this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(function () {
                 this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(function () {
-                    if (_this._lastControlOver && _this._lastControlOver.onPointerOutObservable.hasObservers()) {
-                        _this._lastControlOver.onPointerOutObservable.notifyObservers(_this._lastControlOver);
+                    if (_this._lastControlOver) {
+                        _this._lastControlOver._onPointerOut();
                     }
                     }
                     _this._lastControlOver = null;
                     _this._lastControlOver = null;
                     if (_this._lastControlDown) {
                     if (_this._lastControlDown) {

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


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

@@ -5,6 +5,7 @@
 - Engine can now be initialized with an existing webgl context ([deltakosh](https://github.com/deltakosh))
 - Engine can now be initialized with an existing webgl context ([deltakosh](https://github.com/deltakosh))
 
 
 ## Updates
 ## Updates
+- GUI: Added support for pointer move events on projected UI ([deltakosh](https://github.com/deltakosh))
 - Normals are generated automatically by StandardMaterial if meshes do not have normals ([deltakosh](https://github.com/deltakosh))
 - Normals are generated automatically by StandardMaterial if meshes do not have normals ([deltakosh](https://github.com/deltakosh))
 - Added `mesh.onMaterialChangedObservable` to notify when a new material is set ([deltakosh](https://github.com/deltakosh))
 - Added `mesh.onMaterialChangedObservable` to notify when a new material is set ([deltakosh](https://github.com/deltakosh))
 
 

+ 15 - 7
gui/src/advancedDynamicTexture.ts

@@ -273,8 +273,8 @@ module BABYLON.GUI {
             if (!this._rootContainer._processPicking(x, y, type)) {
             if (!this._rootContainer._processPicking(x, y, type)) {
 
 
                 if (type === BABYLON.PointerEventTypes.POINTERMOVE) {
                 if (type === BABYLON.PointerEventTypes.POINTERMOVE) {
-                    if (this._lastControlOver && this._lastControlOver.onPointerOutObservable.hasObservers()) {
-                        this._lastControlOver.onPointerOutObservable.notifyObservers(this._lastControlOver);
+                    if (this._lastControlOver) {
+                        this._lastControlOver._onPointerOut();
                     }
                     }
                     
                     
                     this._lastControlOver = null;
                     this._lastControlOver = null;
@@ -300,10 +300,12 @@ module BABYLON.GUI {
             this._attachToOnBlur(scene);
             this._attachToOnBlur(scene);
         }
         }
 
 
-        public attachToMesh(mesh: AbstractMesh): void {
+        public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {
             var scene = this.getScene();
             var scene = this.getScene();
             this._pointerObserver = scene.onPointerObservable.add((pi, state) => {
             this._pointerObserver = scene.onPointerObservable.add((pi, state) => {
-                if (pi.type !== BABYLON.PointerEventTypes.POINTERUP && pi.type !== BABYLON.PointerEventTypes.POINTERDOWN) {
+                if (pi.type !== BABYLON.PointerEventTypes.POINTERMOVE 
+                    && pi.type !== BABYLON.PointerEventTypes.POINTERUP
+                    && pi.type !== BABYLON.PointerEventTypes.POINTERDOWN) {
                     return;
                     return;
                 }
                 }
 
 
@@ -316,17 +318,23 @@ module BABYLON.GUI {
                         this._lastControlDown.forcePointerUp();
                         this._lastControlDown.forcePointerUp();
                     }
                     }
                     this._lastControlDown = null;  
                     this._lastControlDown = null;  
+                } else if (pi.type === BABYLON.PointerEventTypes.POINTERMOVE) {
+                    if (this._lastControlOver) {
+                        this._lastControlOver._onPointerOut();
+                    }              
+                    this._lastControlOver = null;
                 }
                 }
             });
             });
 
 
+            mesh.enablePointerMoveEvents = supportPointerMove;
             this._attachToOnBlur(scene);
             this._attachToOnBlur(scene);
         }
         }
 
 
         private _attachToOnBlur(scene: Scene): void {
         private _attachToOnBlur(scene: Scene): void {
             this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(() => {
             this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(() => {
-                if (this._lastControlOver && this._lastControlOver.onPointerOutObservable.hasObservers()) {
-                    this._lastControlOver.onPointerOutObservable.notifyObservers(this._lastControlOver);
-                }                
+                if (this._lastControlOver) {
+                    this._lastControlOver._onPointerOut();
+                }            
                 this._lastControlOver = null;
                 this._lastControlOver = null;
 
 
                 if (this._lastControlDown) {
                 if (this._lastControlDown) {

+ 1 - 1
gui/src/controls/button.ts

@@ -63,7 +63,7 @@ module BABYLON.GUI {
             return true;
             return true;
         }
         }
 
 
-        protected _onPointerOut(): void {
+        public _onPointerOut(): void {
             if (this.pointerOutAnimation) {
             if (this.pointerOutAnimation) {
                 this.pointerOutAnimation();
                 this.pointerOutAnimation();
             }
             }

+ 1 - 1
gui/src/controls/control.ts

@@ -768,7 +768,7 @@ module BABYLON.GUI {
             return true;
             return true;
         }
         }
 
 
-        protected _onPointerOut(): void {
+        public _onPointerOut(): void {
             this._enterCount = 0;
             this._enterCount = 0;
             if (this.onPointerOutObservable.hasObservers()) {
             if (this.onPointerOutObservable.hasObservers()) {
                 this.onPointerOutObservable.notifyObservers(this);
                 this.onPointerOutObservable.notifyObservers(this);

+ 1 - 0
src/Mesh/babylon.abstractMesh.ts

@@ -133,6 +133,7 @@
         public showBoundingBox = false;
         public showBoundingBox = false;
         public showSubMeshesBoundingBox = false;
         public showSubMeshesBoundingBox = false;
         public isBlocker = false;
         public isBlocker = false;
+        public enablePointerMoveEvents = false;
         public renderingGroupId = 0;
         public renderingGroupId = 0;
         private _material: Material
         private _material: Material
         public get material(): Material {
         public get material(): Material {

+ 1 - 1
src/babylon.scene.ts

@@ -1181,7 +1181,7 @@
                 var canvas = this._engine.getRenderingCanvas();
                 var canvas = this._engine.getRenderingCanvas();
 
 
                 if (!this.pointerMovePredicate) {
                 if (!this.pointerMovePredicate) {
-                    this.pointerMovePredicate = (mesh: AbstractMesh): boolean => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined));
+                    this.pointerMovePredicate = (mesh: AbstractMesh): boolean => mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled() && (mesh.enablePointerMoveEvents || this.constantlyUpdateMeshUnderPointer || (mesh.actionManager !== null && mesh.actionManager !== undefined));
                 }
                 }
 
 
                 // Meshes
                 // Meshes