Explorar o código

Merge remote-tracking branch 'BabylonJS/master'

Raanan Weber %!s(int64=9) %!d(string=hai) anos
pai
achega
1124394e44
Modificáronse 36 ficheiros con 1083 adicións e 895 borrados
  1. 6 6
      Exporters/Blender/io_export_babylon.py
  2. 23 23
      dist/preview release/babylon.core.js
  3. 683 679
      dist/preview release/babylon.d.ts
  4. 29 29
      dist/preview release/babylon.js
  5. 107 30
      dist/preview release/babylon.max.js
  6. 28 28
      dist/preview release/babylon.noworker.js
  7. 1 0
      dist/preview release/what's new.md
  8. 2 2
      materialsLibrary/dist/babylon.fireMaterial.js
  9. 1 1
      materialsLibrary/dist/babylon.fireMaterial.min.js
  10. 2 0
      materialsLibrary/materials/fire/fire.fragment.fx
  11. 4 0
      materialsLibrary/materials/fire/fire.vertex.fx
  12. 1 1
      src/Actions/babylon.action.js
  13. 2 2
      src/Actions/babylon.actionManager.js
  14. 4 4
      src/Actions/babylon.condition.js
  15. 12 12
      src/Actions/babylon.directActions.js
  16. 1 1
      src/Actions/babylon.interpolateValueAction.js
  17. 1 1
      src/Animations/babylon.animatable.js
  18. 4 4
      src/Animations/babylon.animation.js
  19. 13 13
      src/Animations/babylon.easing.js
  20. 1 1
      src/Audio/babylon.analyser.js
  21. 1 1
      src/Audio/babylon.audioEngine.js
  22. 1 1
      src/Audio/babylon.sound.js
  23. 1 1
      src/Audio/babylon.soundtrack.js
  24. 3 1
      src/Cameras/Inputs/babylon.arcrotatecamera.input.mousewheel.ts
  25. 16 7
      src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.ts
  26. 14 6
      src/Cameras/Inputs/babylon.freecamera.input.mouse.ts
  27. 5 3
      src/Cameras/Inputs/babylon.freecamera.input.touch.ts
  28. 1 1
      src/Debug/babylon.debugLayer.js
  29. 1 1
      src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.js
  30. 1 1
      src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.js
  31. 1 1
      src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.js
  32. 9 5
      src/Tools/babylon.observable.ts
  33. 2 2
      src/babylon.engine.js
  34. 1 1
      src/babylon.node.js
  35. 61 11
      src/babylon.scene.js
  36. 40 15
      src/babylon.scene.ts

+ 6 - 6
Exporters/Blender/io_export_babylon.py

@@ -1,7 +1,7 @@
 bl_info = {
 bl_info = {
     'name': 'Babylon.js',
     'name': 'Babylon.js',
     'author': 'David Catuhe, Jeff Palmer',
     'author': 'David Catuhe, Jeff Palmer',
-    'version': (4, 4, 2),
+    'version': (4, 4, 3),
     'blender': (2, 75, 0),
     'blender': (2, 75, 0),
     'location': 'File > Export > Babylon.js (.babylon)',
     'location': 'File > Export > Babylon.js (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',
@@ -601,7 +601,7 @@ class FCurveAnimatable:
                 scaleAnimation = VectorAnimation(object, 'scaling', 'scale')
                 scaleAnimation = VectorAnimation(object, 'scaling', 'scale')
 
 
             self.ranges = []
             self.ranges = []
-            frameOffset = bpy.context.scene.frame_start
+            frameOffset = bpy.context.scene.frame_start - 1
 
 
             for action in bpy.data.actions:
             for action in bpy.data.actions:
                 # get the range / assigning the action to the object
                 # get the range / assigning the action to the object
@@ -1401,7 +1401,7 @@ class Skeleton:
 
 
         if (skeleton.animation_data):
         if (skeleton.animation_data):
             self.ranges = []
             self.ranges = []
-            frameOffset = scene.frame_start
+            frameOffset = scene.frame_start - 1
             for action in bpy.data.actions:
             for action in bpy.data.actions:
                 # get the range / assigning the action to the object
                 # get the range / assigning the action to the object
                 animationRange = AnimationRange.actionPrep(skeleton, action, FRAME_BASED_ANIMATION, frameOffset)
                 animationRange = AnimationRange.actionPrep(skeleton, action, FRAME_BASED_ANIMATION, frameOffset)
@@ -1459,7 +1459,7 @@ class Skeleton:
         file_handler.write(']')
         file_handler.write(']')
 
 
         if hasattr(self, 'ranges'):
         if hasattr(self, 'ranges'):
-            file_handler.write(',"ranges":[')
+            file_handler.write('\n,"ranges":[')
             first = True
             first = True
             for range in self.ranges:
             for range in self.ranges:
                 if first != True:
                 if first != True:
@@ -2232,7 +2232,7 @@ class AnimationRange:
     def __init__(self, name, frames, frameOffset):
     def __init__(self, name, frames, frameOffset):
         self.name = name
         self.name = name
         self.highest_frame = frames[len(frames) - 1]
         self.highest_frame = frames[len(frames) - 1]
-        self.frame_start = frameOffset
+        self.frame_start = frameOffset + 1
         self.frame_end   = frameOffset + self.highest_frame
         self.frame_end   = frameOffset + self.highest_frame
         self.frames = frames
         self.frames = frames
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -2320,7 +2320,7 @@ class Animation:
             if first != True:
             if first != True:
                 file_handler.write(',')
                 file_handler.write(',')
             first = False
             first = False
-            file_handler.write('{')
+            file_handler.write('\n{')
             write_int(file_handler, 'frame', self.frames[frame_idx], True)
             write_int(file_handler, 'frame', self.frames[frame_idx], True)
             value_idx = self.values[frame_idx]
             value_idx = self.values[frame_idx]
             if self.dataType == ANIMATIONTYPE_MATRIX:
             if self.dataType == ANIMATIONTYPE_MATRIX:

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 23 - 23
dist/preview release/babylon.core.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 683 - 679
dist/preview release/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 29 - 29
dist/preview release/babylon.js


+ 107 - 30
dist/preview release/babylon.max.js

@@ -3091,8 +3091,9 @@ var BABYLON;
     }());
     }());
     BABYLON.EventState = EventState;
     BABYLON.EventState = EventState;
     var Observer = (function () {
     var Observer = (function () {
-        function Observer(callback) {
+        function Observer(callback, mask) {
             this.callback = callback;
             this.callback = callback;
+            this.mask = mask;
         }
         }
         return Observer;
         return Observer;
     }());
     }());
@@ -3104,14 +3105,16 @@ var BABYLON;
         /**
         /**
          * Create a new Observer with the specified callback
          * Create a new Observer with the specified callback
          * @param callback the callback that will be executed for that Observer
          * @param callback the callback that will be executed for that Observer
+         * @param mash the mask used to filter observers
          * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
          * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
          */
          */
-        Observable.prototype.add = function (callback, insertFirst) {
+        Observable.prototype.add = function (callback, mask, insertFirst) {
+            if (mask === void 0) { mask = -1; }
             if (insertFirst === void 0) { insertFirst = false; }
             if (insertFirst === void 0) { insertFirst = false; }
             if (!callback) {
             if (!callback) {
                 return null;
                 return null;
             }
             }
-            var observer = new Observer(callback);
+            var observer = new Observer(callback, mask);
             if (insertFirst) {
             if (insertFirst) {
                 this._observers.unshift(observer);
                 this._observers.unshift(observer);
             }
             }
@@ -3148,12 +3151,16 @@ var BABYLON;
         /**
         /**
          * Notify all Observers by calling their respective callback with the given data
          * Notify all Observers by calling their respective callback with the given data
          * @param eventData
          * @param eventData
+         * @param mask
          */
          */
-        Observable.prototype.notifyObservers = function (eventData) {
+        Observable.prototype.notifyObservers = function (eventData, mask) {
+            if (mask === void 0) { mask = -1; }
             var state = new EventState();
             var state = new EventState();
             for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
             for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
                 var obs = _a[_i];
                 var obs = _a[_i];
-                obs.callback(eventData, state);
+                if (obs.mask & mask) {
+                    obs.callback(eventData, state);
+                }
                 if (state.skipNextObervers) {
                 if (state.skipNextObervers) {
                     break;
                     break;
                 }
                 }
@@ -11637,8 +11644,12 @@ var BABYLON;
                 var engine = this.camera.getEngine();
                 var engine = this.camera.getEngine();
                 this._pointerInput = function (p, s) {
                 this._pointerInput = function (p, s) {
                     var evt = p.event;
                     var evt = p.event;
-                    if (p.type === 1 /* PointerDown */) {
-                        //   evt.srcElement.setPointerCapture(evt.pointerId);
+                    if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) {
+                        try {
+                            evt.srcElement.setPointerCapture(evt.pointerId);
+                        }
+                        catch (e) {
+                        }
                         _this.previousPosition = {
                         _this.previousPosition = {
                             x: evt.clientX,
                             x: evt.clientX,
                             y: evt.clientY
                             y: evt.clientY
@@ -11647,14 +11658,18 @@ var BABYLON;
                             evt.preventDefault();
                             evt.preventDefault();
                         }
                         }
                     }
                     }
-                    else if (p.type === 2 /* PointerUp */) {
-                        //  evt.srcElement.releasePointerCapture(evt.pointerId);
+                    else if (p.type === BABYLON.PointerEventTypes.POINTERUP) {
+                        try {
+                            evt.srcElement.releasePointerCapture(evt.pointerId);
+                        }
+                        catch (e) {
+                        }
                         _this.previousPosition = null;
                         _this.previousPosition = null;
                         if (!noPreventDefault) {
                         if (!noPreventDefault) {
                             evt.preventDefault();
                             evt.preventDefault();
                         }
                         }
                     }
                     }
-                    else if (p.type === 3 /* PointerMove */) {
+                    else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) {
                         if (!_this.previousPosition && !engine.isPointerLock) {
                         if (!_this.previousPosition && !engine.isPointerLock) {
                             return;
                             return;
                         }
                         }
@@ -11680,7 +11695,7 @@ var BABYLON;
                     }
                     }
                 };
                 };
             }
             }
-            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE);
         };
         };
         FreeCameraMouseInput.prototype.detachControl = function (element) {
         FreeCameraMouseInput.prototype.detachControl = function (element) {
             if (this._observer && element) {
             if (this._observer && element) {
@@ -11839,7 +11854,7 @@ var BABYLON;
                 };
                 };
                 this._pointerInput = function (p, s) {
                 this._pointerInput = function (p, s) {
                     var evt = p.event;
                     var evt = p.event;
-                    if (p.type === 1 /* PointerDown */) {
+                    if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -11856,7 +11871,7 @@ var BABYLON;
                             y: evt.clientY
                             y: evt.clientY
                         };
                         };
                     }
                     }
-                    else if (p.type === 2 /* PointerUp */) {
+                    else if (p.type === BABYLON.PointerEventTypes.POINTERUP) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -11876,7 +11891,7 @@ var BABYLON;
                         _this._offsetX = null;
                         _this._offsetX = null;
                         _this._offsetY = null;
                         _this._offsetY = null;
                     }
                     }
-                    else if (p.type === 3 /* PointerMove */) {
+                    else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -11895,6 +11910,7 @@ var BABYLON;
                     }
                     }
                 };
                 };
             }
             }
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE);
             element.addEventListener("blur", this._onLostFocus);
             element.addEventListener("blur", this._onLostFocus);
         };
         };
         FreeCameraTouchInput.prototype.detachControl = function (element) {
         FreeCameraTouchInput.prototype.detachControl = function (element) {
@@ -12304,6 +12320,9 @@ var BABYLON;
         ArcRotateCameraMouseWheelInput.prototype.attachControl = function (element, noPreventDefault) {
         ArcRotateCameraMouseWheelInput.prototype.attachControl = function (element, noPreventDefault) {
             var _this = this;
             var _this = this;
             this._wheel = function (p, s) {
             this._wheel = function (p, s) {
+                //sanity check - this should be a PointerWheel event.
+                if (p.type !== BABYLON.PointerEventTypes.POINTERWHEEL)
+                    return;
                 var event = p.event;
                 var event = p.event;
                 var delta = 0;
                 var delta = 0;
                 if (event.wheelDelta) {
                 if (event.wheelDelta) {
@@ -12320,7 +12339,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             };
             };
-            this._observer = this.camera.getScene().onPointerObservable.add(this._wheel);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, BABYLON.PointerEventTypes.POINTERWHEEL);
         };
         };
         ArcRotateCameraMouseWheelInput.prototype.detachControl = function (element) {
         ArcRotateCameraMouseWheelInput.prototype.detachControl = function (element) {
             if (this._observer && element) {
             if (this._observer && element) {
@@ -12366,8 +12385,12 @@ var BABYLON;
             var previousPinchDistance = 0;
             var previousPinchDistance = 0;
             this._pointerInput = function (p, s) {
             this._pointerInput = function (p, s) {
                 var evt = p.event;
                 var evt = p.event;
-                if (p.type === 1 /* PointerDown */) {
-                    evt.srcElement.setPointerCapture(evt.pointerId);
+                if (p.type === BABYLON.PointerEventTypes.POINTERDOWN) {
+                    try {
+                        evt.srcElement.setPointerCapture(evt.pointerId);
+                    }
+                    catch (e) {
+                    }
                     // Manage panning with right click
                     // Manage panning with right click
                     _this._isRightClick = evt.button === 2;
                     _this._isRightClick = evt.button === 2;
                     // manage pointers
                     // manage pointers
@@ -12377,8 +12400,12 @@ var BABYLON;
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
                 }
                 }
-                else if (p.type === 2 /* PointerUp */) {
-                    evt.srcElement.releasePointerCapture(evt.pointerId);
+                else if (p.type === BABYLON.PointerEventTypes.POINTERUP) {
+                    try {
+                        evt.srcElement.releasePointerCapture(evt.pointerId);
+                    }
+                    catch (e) {
+                    }
                     cacheSoloPointer = null;
                     cacheSoloPointer = null;
                     previousPinchDistance = 0;
                     previousPinchDistance = 0;
                     //would be better to use pointers.remove(evt.pointerId) for multitouch gestures, 
                     //would be better to use pointers.remove(evt.pointerId) for multitouch gestures, 
@@ -12390,7 +12417,7 @@ var BABYLON;
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
                 }
                 }
-                else if (p.type === 3 /* PointerMove */) {
+                else if (p.type === BABYLON.PointerEventTypes.POINTERMOVE) {
                     if (!noPreventDefault) {
                     if (!noPreventDefault) {
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
@@ -12434,7 +12461,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             };
             };
-            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, BABYLON.PointerEventTypes.POINTERDOWN | BABYLON.PointerEventTypes.POINTERUP | BABYLON.PointerEventTypes.POINTERMOVE);
             this._onContextMenu = function (evt) {
             this._onContextMenu = function (evt) {
                 evt.preventDefault();
                 evt.preventDefault();
             };
             };
@@ -14092,9 +14119,55 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    var PointerEventTypes = (function () {
+        function PointerEventTypes() {
+        }
+        Object.defineProperty(PointerEventTypes, "POINTERDOWN", {
+            get: function () {
+                return PointerEventTypes._POINTERDOWN;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERUP", {
+            get: function () {
+                return PointerEventTypes._POINTERUP;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERMOVE", {
+            get: function () {
+                return PointerEventTypes._POINTERMOVE;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERWHEEL", {
+            get: function () {
+                return PointerEventTypes._POINTERWHEEL;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERPICK", {
+            get: function () {
+                return PointerEventTypes._POINTERPICK;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        PointerEventTypes._POINTERDOWN = 0x01;
+        PointerEventTypes._POINTERUP = 0x02;
+        PointerEventTypes._POINTERMOVE = 0x04;
+        PointerEventTypes._POINTERWHEEL = 0x08;
+        PointerEventTypes._POINTERPICK = 0x10;
+        return PointerEventTypes;
+    }());
+    BABYLON.PointerEventTypes = PointerEventTypes;
     /**
     /**
      * This type contains all the data related to a pointer event in Babylon.js.
      * This type contains all the data related to a pointer event in Babylon.js.
-     * The event member is an instnce of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel
+     * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The differents event types can be found in the PointerEventTypes class.
      */
      */
     var PointerInfo = (function () {
     var PointerInfo = (function () {
         function PointerInfo(type, event, pickInfo) {
         function PointerInfo(type, event, pickInfo) {
@@ -14600,8 +14673,9 @@ var BABYLON;
                     _this.onPointerMove(evt, pickResult);
                     _this.onPointerMove(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(evt.type === "mousewheel" ? 4 /* PointerWheel */ : 3 /* PointerMove */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = evt.type === "mousewheel" ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
             };
             };
             this._onPointerDown = function (evt) {
             this._onPointerDown = function (evt) {
@@ -14657,8 +14731,9 @@ var BABYLON;
                     _this.onPointerDown(evt, pickResult);
                     _this.onPointerDown(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(1 /* PointerDown */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = PointerEventTypes.POINTERDOWN;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
                 // Sprites
                 // Sprites
                 _this._pickedDownSprite = null;
                 _this._pickedDownSprite = null;
@@ -14701,8 +14776,9 @@ var BABYLON;
                             _this.onPointerPick(evt, pickResult);
                             _this.onPointerPick(evt, pickResult);
                         }
                         }
                         if (_this.onPointerObservable.hasObservers()) {
                         if (_this.onPointerObservable.hasObservers()) {
-                            var pi = new PointerInfo(5 /* PointerPick */, evt, pickResult);
-                            _this.onPointerObservable.notifyObservers(pi);
+                            var type = PointerEventTypes.POINTERPICK;
+                            var pi = new PointerInfo(type, evt, pickResult);
+                            _this.onPointerObservable.notifyObservers(pi, type);
                         }
                         }
                     }
                     }
                     if (pickResult.pickedMesh.actionManager) {
                     if (pickResult.pickedMesh.actionManager) {
@@ -14719,8 +14795,9 @@ var BABYLON;
                     _this.onPointerUp(evt, pickResult);
                     _this.onPointerUp(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(2 /* PointerUp */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = PointerEventTypes.POINTERUP;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
                 _this._startingPointerTime = 0;
                 _this._startingPointerTime = 0;
                 // Sprites
                 // Sprites

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 28 - 28
dist/preview release/babylon.noworker.js


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

@@ -30,6 +30,7 @@
     - LinesMesh class now supports Intersection. Added the intersectionThreshold property to set a tolerance margin during intersection with wire lines. ([nockawa](https://github.com/nockawa))
     - LinesMesh class now supports Intersection. Added the intersectionThreshold property to set a tolerance margin during intersection with wire lines. ([nockawa](https://github.com/nockawa))
     - Geometry.boundingBias property to enlarge the boundingInfo objects ([nockawa](https://github.com/nockawa))
     - Geometry.boundingBias property to enlarge the boundingInfo objects ([nockawa](https://github.com/nockawa))
     - Tools.ExtractMinAndMax & ExtractMinAndMaxIndexed now supports an optional Bias for Extent computation.
     - Tools.ExtractMinAndMax & ExtractMinAndMaxIndexed now supports an optional Bias for Extent computation.
+	- Scene.onPointerObservable property added to enable a unique Observable event for user input (see ArcRotateCamera inputs for examples) ([nockawa](https://github.com/nockawa))
 
 
   - **API doc**
   - **API doc**
     - class `SolidParticleSystem` documented
     - class `SolidParticleSystem` documented

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
materialsLibrary/dist/babylon.fireMaterial.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
materialsLibrary/dist/babylon.fireMaterial.min.js


+ 2 - 0
materialsLibrary/materials/fire/fire.fragment.fx

@@ -21,9 +21,11 @@ uniform vec2 vDiffuseInfos;
 uniform sampler2D distortionSampler;
 uniform sampler2D distortionSampler;
 uniform sampler2D opacitySampler;
 uniform sampler2D opacitySampler;
 
 
+#ifdef DIFFUSE
 varying vec2 vDistortionCoords1;
 varying vec2 vDistortionCoords1;
 varying vec2 vDistortionCoords2;
 varying vec2 vDistortionCoords2;
 varying vec2 vDistortionCoords3;
 varying vec2 vDistortionCoords3;
+#endif
 
 
 #include<clipPlaneFragmentDeclaration>
 #include<clipPlaneFragmentDeclaration>
 
 

+ 4 - 0
materialsLibrary/materials/fire/fire.vertex.fx

@@ -44,9 +44,11 @@ varying vec4 vColor;
 uniform float time;
 uniform float time;
 uniform float speed;
 uniform float speed;
 
 
+#ifdef DIFFUSE
 varying vec2 vDistortionCoords1;
 varying vec2 vDistortionCoords1;
 varying vec2 vDistortionCoords2;
 varying vec2 vDistortionCoords2;
 varying vec2 vDistortionCoords3;
 varying vec2 vDistortionCoords3;
+#endif
 
 
 void main(void) {
 void main(void) {
 
 
@@ -80,6 +82,7 @@ void main(void) {
 	gl_PointSize = pointSize;
 	gl_PointSize = pointSize;
 #endif
 #endif
 
 
+#ifdef DIFFUSE
 	// Fire
 	// Fire
 	vec3 layerSpeed = vec3(-0.2, -0.52, -0.1) * speed;
 	vec3 layerSpeed = vec3(-0.2, -0.52, -0.1) * speed;
 	
 	
@@ -91,4 +94,5 @@ void main(void) {
 	
 	
 	vDistortionCoords3.x = uv.x;
 	vDistortionCoords3.x = uv.x;
 	vDistortionCoords3.y = uv.y + layerSpeed.z * time / 1000.0;
 	vDistortionCoords3.y = uv.y + layerSpeed.z * time / 1000.0;
+#endif
 }
 }

+ 1 - 1
src/Actions/babylon.action.js

@@ -67,6 +67,6 @@ var BABYLON;
             return this._actionManager._getEffectiveTarget(target, propertyPath);
             return this._actionManager._getEffectiveTarget(target, propertyPath);
         };
         };
         return Action;
         return Action;
-    }());
+    })();
     BABYLON.Action = Action;
     BABYLON.Action = Action;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 2 - 2
src/Actions/babylon.actionManager.js

@@ -47,7 +47,7 @@ var BABYLON;
             return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);
             return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);
         };
         };
         return ActionEvent;
         return ActionEvent;
-    }());
+    })();
     BABYLON.ActionEvent = ActionEvent;
     BABYLON.ActionEvent = ActionEvent;
     /**
     /**
      * Action Manager manages all events to be triggered on a given mesh or the global scene.
      * Action Manager manages all events to be triggered on a given mesh or the global scene.
@@ -468,6 +468,6 @@ var BABYLON;
         ActionManager.DragMovementThreshold = 10; // in pixels
         ActionManager.DragMovementThreshold = 10; // in pixels
         ActionManager.LongPressDelay = 500; // in milliseconds
         ActionManager.LongPressDelay = 500; // in milliseconds
         return ActionManager;
         return ActionManager;
-    }());
+    })();
     BABYLON.ActionManager = ActionManager;
     BABYLON.ActionManager = ActionManager;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 4 - 4
src/Actions/babylon.condition.js

@@ -19,7 +19,7 @@ var BABYLON;
             return this._actionManager._getEffectiveTarget(target, propertyPath);
             return this._actionManager._getEffectiveTarget(target, propertyPath);
         };
         };
         return Condition;
         return Condition;
-    }());
+    })();
     BABYLON.Condition = Condition;
     BABYLON.Condition = Condition;
     var ValueCondition = (function (_super) {
     var ValueCondition = (function (_super) {
         __extends(ValueCondition, _super);
         __extends(ValueCondition, _super);
@@ -86,7 +86,7 @@ var BABYLON;
         ValueCondition._IsGreater = 2;
         ValueCondition._IsGreater = 2;
         ValueCondition._IsLesser = 3;
         ValueCondition._IsLesser = 3;
         return ValueCondition;
         return ValueCondition;
-    }(Condition));
+    })(Condition);
     BABYLON.ValueCondition = ValueCondition;
     BABYLON.ValueCondition = ValueCondition;
     var PredicateCondition = (function (_super) {
     var PredicateCondition = (function (_super) {
         __extends(PredicateCondition, _super);
         __extends(PredicateCondition, _super);
@@ -98,7 +98,7 @@ var BABYLON;
             return this.predicate();
             return this.predicate();
         };
         };
         return PredicateCondition;
         return PredicateCondition;
-    }(Condition));
+    })(Condition);
     BABYLON.PredicateCondition = PredicateCondition;
     BABYLON.PredicateCondition = PredicateCondition;
     var StateCondition = (function (_super) {
     var StateCondition = (function (_super) {
         __extends(StateCondition, _super);
         __extends(StateCondition, _super);
@@ -112,6 +112,6 @@ var BABYLON;
             return this._target.state === this.value;
             return this._target.state === this.value;
         };
         };
         return StateCondition;
         return StateCondition;
-    }(Condition));
+    })(Condition);
     BABYLON.StateCondition = StateCondition;
     BABYLON.StateCondition = StateCondition;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 12 - 12
src/Actions/babylon.directActions.js

@@ -20,7 +20,7 @@ var BABYLON;
             this._target[this._property] = !this._target[this._property];
             this._target[this._property] = !this._target[this._property];
         };
         };
         return SwitchBooleanAction;
         return SwitchBooleanAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.SwitchBooleanAction = SwitchBooleanAction;
     BABYLON.SwitchBooleanAction = SwitchBooleanAction;
     var SetStateAction = (function (_super) {
     var SetStateAction = (function (_super) {
         __extends(SetStateAction, _super);
         __extends(SetStateAction, _super);
@@ -33,7 +33,7 @@ var BABYLON;
             this._target.state = this.value;
             this._target.state = this.value;
         };
         };
         return SetStateAction;
         return SetStateAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.SetStateAction = SetStateAction;
     BABYLON.SetStateAction = SetStateAction;
     var SetValueAction = (function (_super) {
     var SetValueAction = (function (_super) {
         __extends(SetValueAction, _super);
         __extends(SetValueAction, _super);
@@ -51,7 +51,7 @@ var BABYLON;
             this._target[this._property] = this.value;
             this._target[this._property] = this.value;
         };
         };
         return SetValueAction;
         return SetValueAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.SetValueAction = SetValueAction;
     BABYLON.SetValueAction = SetValueAction;
     var IncrementValueAction = (function (_super) {
     var IncrementValueAction = (function (_super) {
         __extends(IncrementValueAction, _super);
         __extends(IncrementValueAction, _super);
@@ -72,7 +72,7 @@ var BABYLON;
             this._target[this._property] += this.value;
             this._target[this._property] += this.value;
         };
         };
         return IncrementValueAction;
         return IncrementValueAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.IncrementValueAction = IncrementValueAction;
     BABYLON.IncrementValueAction = IncrementValueAction;
     var PlayAnimationAction = (function (_super) {
     var PlayAnimationAction = (function (_super) {
         __extends(PlayAnimationAction, _super);
         __extends(PlayAnimationAction, _super);
@@ -90,7 +90,7 @@ var BABYLON;
             scene.beginAnimation(this._target, this.from, this.to, this.loop);
             scene.beginAnimation(this._target, this.from, this.to, this.loop);
         };
         };
         return PlayAnimationAction;
         return PlayAnimationAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.PlayAnimationAction = PlayAnimationAction;
     BABYLON.PlayAnimationAction = PlayAnimationAction;
     var StopAnimationAction = (function (_super) {
     var StopAnimationAction = (function (_super) {
         __extends(StopAnimationAction, _super);
         __extends(StopAnimationAction, _super);
@@ -105,7 +105,7 @@ var BABYLON;
             scene.stopAnimation(this._target);
             scene.stopAnimation(this._target);
         };
         };
         return StopAnimationAction;
         return StopAnimationAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.StopAnimationAction = StopAnimationAction;
     BABYLON.StopAnimationAction = StopAnimationAction;
     var DoNothingAction = (function (_super) {
     var DoNothingAction = (function (_super) {
         __extends(DoNothingAction, _super);
         __extends(DoNothingAction, _super);
@@ -116,7 +116,7 @@ var BABYLON;
         DoNothingAction.prototype.execute = function () {
         DoNothingAction.prototype.execute = function () {
         };
         };
         return DoNothingAction;
         return DoNothingAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.DoNothingAction = DoNothingAction;
     BABYLON.DoNothingAction = DoNothingAction;
     var CombineAction = (function (_super) {
     var CombineAction = (function (_super) {
         __extends(CombineAction, _super);
         __extends(CombineAction, _super);
@@ -136,7 +136,7 @@ var BABYLON;
             }
             }
         };
         };
         return CombineAction;
         return CombineAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.CombineAction = CombineAction;
     BABYLON.CombineAction = CombineAction;
     var ExecuteCodeAction = (function (_super) {
     var ExecuteCodeAction = (function (_super) {
         __extends(ExecuteCodeAction, _super);
         __extends(ExecuteCodeAction, _super);
@@ -148,7 +148,7 @@ var BABYLON;
             this.func(evt);
             this.func(evt);
         };
         };
         return ExecuteCodeAction;
         return ExecuteCodeAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.ExecuteCodeAction = ExecuteCodeAction;
     BABYLON.ExecuteCodeAction = ExecuteCodeAction;
     var SetParentAction = (function (_super) {
     var SetParentAction = (function (_super) {
         __extends(SetParentAction, _super);
         __extends(SetParentAction, _super);
@@ -169,7 +169,7 @@ var BABYLON;
             this._target.parent = this._parent;
             this._target.parent = this._parent;
         };
         };
         return SetParentAction;
         return SetParentAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.SetParentAction = SetParentAction;
     BABYLON.SetParentAction = SetParentAction;
     var PlaySoundAction = (function (_super) {
     var PlaySoundAction = (function (_super) {
         __extends(PlaySoundAction, _super);
         __extends(PlaySoundAction, _super);
@@ -184,7 +184,7 @@ var BABYLON;
                 this._sound.play();
                 this._sound.play();
         };
         };
         return PlaySoundAction;
         return PlaySoundAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.PlaySoundAction = PlaySoundAction;
     BABYLON.PlaySoundAction = PlaySoundAction;
     var StopSoundAction = (function (_super) {
     var StopSoundAction = (function (_super) {
         __extends(StopSoundAction, _super);
         __extends(StopSoundAction, _super);
@@ -199,6 +199,6 @@ var BABYLON;
                 this._sound.stop();
                 this._sound.stop();
         };
         };
         return StopSoundAction;
         return StopSoundAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.StopSoundAction = StopSoundAction;
     BABYLON.StopSoundAction = StopSoundAction;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Actions/babylon.interpolateValueAction.js

@@ -60,6 +60,6 @@ var BABYLON;
             scene.beginDirectAnimation(this._target, [animation], 0, 100, false, 1, this.onInterpolationDone);
             scene.beginDirectAnimation(this._target, [animation], 0, 100, false, 1, this.onInterpolationDone);
         };
         };
         return InterpolateValueAction;
         return InterpolateValueAction;
-    }(BABYLON.Action));
+    })(BABYLON.Action);
     BABYLON.InterpolateValueAction = InterpolateValueAction;
     BABYLON.InterpolateValueAction = InterpolateValueAction;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Animations/babylon.animatable.js

@@ -127,6 +127,6 @@ var BABYLON;
             return running;
             return running;
         };
         };
         return Animatable;
         return Animatable;
-    }());
+    })();
     BABYLON.Animatable = Animatable;
     BABYLON.Animatable = Animatable;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 4 - 4
src/Animations/babylon.animation.js

@@ -10,7 +10,7 @@ var BABYLON;
             return new AnimationRange(this.name, this.from, this.to);
             return new AnimationRange(this.name, this.from, this.to);
         };
         };
         return AnimationRange;
         return AnimationRange;
-    }());
+    })();
     BABYLON.AnimationRange = AnimationRange;
     BABYLON.AnimationRange = AnimationRange;
     /**
     /**
      * Composed of a frame, and an action function
      * Composed of a frame, and an action function
@@ -23,7 +23,7 @@ var BABYLON;
             this.isDone = false;
             this.isDone = false;
         }
         }
         return AnimationEvent;
         return AnimationEvent;
-    }());
+    })();
     BABYLON.AnimationEvent = AnimationEvent;
     BABYLON.AnimationEvent = AnimationEvent;
     var PathCursor = (function () {
     var PathCursor = (function () {
         function PathCursor(path) {
         function PathCursor(path) {
@@ -80,7 +80,7 @@ var BABYLON;
             return this;
             return this;
         };
         };
         return PathCursor;
         return PathCursor;
-    }());
+    })();
     BABYLON.PathCursor = PathCursor;
     BABYLON.PathCursor = PathCursor;
     var Animation = (function () {
     var Animation = (function () {
         function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {
         function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {
@@ -697,6 +697,6 @@ var BABYLON;
         Animation._ANIMATIONLOOPMODE_CYCLE = 1;
         Animation._ANIMATIONLOOPMODE_CYCLE = 1;
         Animation._ANIMATIONLOOPMODE_CONSTANT = 2;
         Animation._ANIMATIONLOOPMODE_CONSTANT = 2;
         return Animation;
         return Animation;
-    }());
+    })();
     BABYLON.Animation = Animation;
     BABYLON.Animation = Animation;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 13 - 13
src/Animations/babylon.easing.js

@@ -58,7 +58,7 @@ var BABYLON;
         EasingFunction._EASINGMODE_EASEOUT = 1;
         EasingFunction._EASINGMODE_EASEOUT = 1;
         EasingFunction._EASINGMODE_EASEINOUT = 2;
         EasingFunction._EASINGMODE_EASEINOUT = 2;
         return EasingFunction;
         return EasingFunction;
-    }());
+    })();
     BABYLON.EasingFunction = EasingFunction;
     BABYLON.EasingFunction = EasingFunction;
     var CircleEase = (function (_super) {
     var CircleEase = (function (_super) {
         __extends(CircleEase, _super);
         __extends(CircleEase, _super);
@@ -70,7 +70,7 @@ var BABYLON;
             return (1.0 - Math.sqrt(1.0 - (gradient * gradient)));
             return (1.0 - Math.sqrt(1.0 - (gradient * gradient)));
         };
         };
         return CircleEase;
         return CircleEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.CircleEase = CircleEase;
     BABYLON.CircleEase = CircleEase;
     var BackEase = (function (_super) {
     var BackEase = (function (_super) {
         __extends(BackEase, _super);
         __extends(BackEase, _super);
@@ -84,7 +84,7 @@ var BABYLON;
             return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient)));
             return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient)));
         };
         };
         return BackEase;
         return BackEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.BackEase = BackEase;
     BABYLON.BackEase = BackEase;
     var BounceEase = (function (_super) {
     var BounceEase = (function (_super) {
         __extends(BounceEase, _super);
         __extends(BounceEase, _super);
@@ -116,7 +116,7 @@ var BABYLON;
             return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2));
             return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2));
         };
         };
         return BounceEase;
         return BounceEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.BounceEase = BounceEase;
     BABYLON.BounceEase = BounceEase;
     var CubicEase = (function (_super) {
     var CubicEase = (function (_super) {
         __extends(CubicEase, _super);
         __extends(CubicEase, _super);
@@ -127,7 +127,7 @@ var BABYLON;
             return (gradient * gradient * gradient);
             return (gradient * gradient * gradient);
         };
         };
         return CubicEase;
         return CubicEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.CubicEase = CubicEase;
     BABYLON.CubicEase = CubicEase;
     var ElasticEase = (function (_super) {
     var ElasticEase = (function (_super) {
         __extends(ElasticEase, _super);
         __extends(ElasticEase, _super);
@@ -151,7 +151,7 @@ var BABYLON;
             return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient));
             return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient));
         };
         };
         return ElasticEase;
         return ElasticEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.ElasticEase = ElasticEase;
     BABYLON.ElasticEase = ElasticEase;
     var ExponentialEase = (function (_super) {
     var ExponentialEase = (function (_super) {
         __extends(ExponentialEase, _super);
         __extends(ExponentialEase, _super);
@@ -167,7 +167,7 @@ var BABYLON;
             return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0));
             return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0));
         };
         };
         return ExponentialEase;
         return ExponentialEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.ExponentialEase = ExponentialEase;
     BABYLON.ExponentialEase = ExponentialEase;
     var PowerEase = (function (_super) {
     var PowerEase = (function (_super) {
         __extends(PowerEase, _super);
         __extends(PowerEase, _super);
@@ -181,7 +181,7 @@ var BABYLON;
             return Math.pow(gradient, y);
             return Math.pow(gradient, y);
         };
         };
         return PowerEase;
         return PowerEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.PowerEase = PowerEase;
     BABYLON.PowerEase = PowerEase;
     var QuadraticEase = (function (_super) {
     var QuadraticEase = (function (_super) {
         __extends(QuadraticEase, _super);
         __extends(QuadraticEase, _super);
@@ -192,7 +192,7 @@ var BABYLON;
             return (gradient * gradient);
             return (gradient * gradient);
         };
         };
         return QuadraticEase;
         return QuadraticEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.QuadraticEase = QuadraticEase;
     BABYLON.QuadraticEase = QuadraticEase;
     var QuarticEase = (function (_super) {
     var QuarticEase = (function (_super) {
         __extends(QuarticEase, _super);
         __extends(QuarticEase, _super);
@@ -203,7 +203,7 @@ var BABYLON;
             return (gradient * gradient * gradient * gradient);
             return (gradient * gradient * gradient * gradient);
         };
         };
         return QuarticEase;
         return QuarticEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.QuarticEase = QuarticEase;
     BABYLON.QuarticEase = QuarticEase;
     var QuinticEase = (function (_super) {
     var QuinticEase = (function (_super) {
         __extends(QuinticEase, _super);
         __extends(QuinticEase, _super);
@@ -214,7 +214,7 @@ var BABYLON;
             return (gradient * gradient * gradient * gradient * gradient);
             return (gradient * gradient * gradient * gradient * gradient);
         };
         };
         return QuinticEase;
         return QuinticEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.QuinticEase = QuinticEase;
     BABYLON.QuinticEase = QuinticEase;
     var SineEase = (function (_super) {
     var SineEase = (function (_super) {
         __extends(SineEase, _super);
         __extends(SineEase, _super);
@@ -225,7 +225,7 @@ var BABYLON;
             return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient)));
             return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient)));
         };
         };
         return SineEase;
         return SineEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.SineEase = SineEase;
     BABYLON.SineEase = SineEase;
     var BezierCurveEase = (function (_super) {
     var BezierCurveEase = (function (_super) {
         __extends(BezierCurveEase, _super);
         __extends(BezierCurveEase, _super);
@@ -244,6 +244,6 @@ var BABYLON;
             return BABYLON.BezierCurve.interpolate(gradient, this.x1, this.y1, this.x2, this.y2);
             return BABYLON.BezierCurve.interpolate(gradient, this.x1, this.y1, this.x2, this.y2);
         };
         };
         return BezierCurveEase;
         return BezierCurveEase;
-    }(EasingFunction));
+    })(EasingFunction);
     BABYLON.BezierCurveEase = BezierCurveEase;
     BABYLON.BezierCurveEase = BezierCurveEase;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Audio/babylon.analyser.js

@@ -106,6 +106,6 @@ var BABYLON;
             }
             }
         };
         };
         return Analyser;
         return Analyser;
-    }());
+    })();
     BABYLON.Analyser = Analyser;
     BABYLON.Analyser = Analyser;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Audio/babylon.audioEngine.js

@@ -101,6 +101,6 @@ var BABYLON;
             }
             }
         };
         };
         return AudioEngine;
         return AudioEngine;
-    }());
+    })();
     BABYLON.AudioEngine = AudioEngine;
     BABYLON.AudioEngine = AudioEngine;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Audio/babylon.sound.js

@@ -547,6 +547,6 @@ var BABYLON;
             return newSound;
             return newSound;
         };
         };
         return Sound;
         return Sound;
-    }());
+    })();
     BABYLON.Sound = Sound;
     BABYLON.Sound = Sound;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/Audio/babylon.soundtrack.js

@@ -96,6 +96,6 @@ var BABYLON;
             }
             }
         };
         };
         return SoundTrack;
         return SoundTrack;
-    }());
+    })();
     BABYLON.SoundTrack = SoundTrack;
     BABYLON.SoundTrack = SoundTrack;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 3 - 1
src/Cameras/Inputs/babylon.arcrotatecamera.input.mousewheel.ts

@@ -10,6 +10,8 @@ module BABYLON {
 
 
         public attachControl(element: HTMLElement, noPreventDefault?: boolean) {
         public attachControl(element: HTMLElement, noPreventDefault?: boolean) {
             this._wheel = (p, s) => {
             this._wheel = (p, s) => {
+                //sanity check - this should be a PointerWheel event.
+                if (p.type !== PointerEventTypes.POINTERWHEEL) return;
                 var event = <MouseWheelEvent>p.event;
                 var event = <MouseWheelEvent>p.event;
                 var delta = 0;
                 var delta = 0;
                 if (event.wheelDelta) {
                 if (event.wheelDelta) {
@@ -28,7 +30,7 @@ module BABYLON {
                 }
                 }
             };
             };
 
 
-            this._observer = this.camera.getScene().onPointerObservable.add(this._wheel);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, PointerEventTypes.POINTERWHEEL);
         }
         }
 
 
         public detachControl(element: HTMLElement) {
         public detachControl(element: HTMLElement) {

+ 16 - 7
src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.ts

@@ -39,8 +39,13 @@ module BABYLON {
 
 
             this._pointerInput = (p, s) => {
             this._pointerInput = (p, s) => {
                 var evt = <PointerEvent>p.event;
                 var evt = <PointerEvent>p.event;
-                if (p.type === PointerEventType.PointerDown) {
-                   // evt.srcElement.setPointerCapture(evt.pointerId);
+                if (p.type === PointerEventTypes.POINTERDOWN) {
+                    try {
+                        evt.srcElement.setPointerCapture(evt.pointerId);
+                    } catch (e) {
+                        //Nothing to do with the error. Execution will continue.
+                    }
+
 
 
                     // Manage panning with right click
                     // Manage panning with right click
                     this._isRightClick = evt.button === 2;
                     this._isRightClick = evt.button === 2;
@@ -51,9 +56,13 @@ module BABYLON {
                     if (!noPreventDefault) {
                     if (!noPreventDefault) {
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
-                } else if (p.type === PointerEventType.PointerUp) {
-                   // evt.srcElement.releasePointerCapture(evt.pointerId);
-
+                } else if (p.type === PointerEventTypes.POINTERUP) {
+                    try {
+                        evt.srcElement.releasePointerCapture(evt.pointerId);
+                    } catch (e) {
+                        //Nothing to do with the error.
+                    }
+                    
                     cacheSoloPointer = null;
                     cacheSoloPointer = null;
                     previousPinchDistance = 0;
                     previousPinchDistance = 0;
 
 
@@ -66,7 +75,7 @@ module BABYLON {
                     if (!noPreventDefault) {
                     if (!noPreventDefault) {
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
-                } else if (p.type === PointerEventType.PointerMove) {
+                } else if (p.type === PointerEventTypes.POINTERMOVE) {
                     if (!noPreventDefault) {
                     if (!noPreventDefault) {
                         evt.preventDefault();
                         evt.preventDefault();
                     }
                     }
@@ -114,7 +123,7 @@ module BABYLON {
                 }
                 }
             }
             }
 
 
-            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, PointerEventTypes.POINTERDOWN | PointerEventTypes.POINTERUP | PointerEventTypes.POINTERMOVE);
 
 
             this._onContextMenu = evt => {
             this._onContextMenu = evt => {
                 evt.preventDefault();
                 evt.preventDefault();

+ 14 - 6
src/Cameras/Inputs/babylon.freecamera.input.mouse.ts

@@ -17,8 +17,12 @@ module BABYLON {
                 var engine = this.camera.getEngine();
                 var engine = this.camera.getEngine();
                 this._pointerInput = (p, s) => {
                 this._pointerInput = (p, s) => {
                     var evt = <PointerEvent>p.event;
                     var evt = <PointerEvent>p.event;
-                    if (p.type === PointerEventType.PointerDown) {
-                     //   evt.srcElement.setPointerCapture(evt.pointerId);
+                    if (p.type === PointerEventTypes.POINTERDOWN) {
+                        try {
+                            evt.srcElement.setPointerCapture(evt.pointerId);
+                        } catch (e) {
+                            //Nothing to do with the error. Execution will continue.
+                        }
 
 
                         this.previousPosition = {
                         this.previousPosition = {
                             x: evt.clientX,
                             x: evt.clientX,
@@ -29,15 +33,19 @@ module BABYLON {
                             evt.preventDefault();
                             evt.preventDefault();
                         }
                         }
                     }
                     }
-                    else if (p.type === PointerEventType.PointerUp) {
-                      //  evt.srcElement.releasePointerCapture(evt.pointerId);
+                    else if (p.type === PointerEventTypes.POINTERUP) {
+                        try {
+                            evt.srcElement.releasePointerCapture(evt.pointerId);
+                        } catch (e) {
+                            //Nothing to do with the error.
+                        }
                         this.previousPosition = null;
                         this.previousPosition = null;
                         if (!noPreventDefault) {
                         if (!noPreventDefault) {
                             evt.preventDefault();
                             evt.preventDefault();
                         }
                         }
                     }
                     }
 
 
-                    else if (p.type === PointerEventType.PointerMove) {
+                    else if (p.type === PointerEventTypes.POINTERMOVE) {
                         if (!this.previousPosition && !engine.isPointerLock) {
                         if (!this.previousPosition && !engine.isPointerLock) {
                             return;
                             return;
                         }
                         }
@@ -68,7 +76,7 @@ module BABYLON {
                 }
                 }
             }
             }
 
 
-            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput);
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, PointerEventTypes.POINTERDOWN | PointerEventTypes.POINTERUP | PointerEventTypes.POINTERMOVE);
         }
         }
 
 
         detachControl(element: HTMLElement) {
         detachControl(element: HTMLElement) {

+ 5 - 3
src/Cameras/Inputs/babylon.freecamera.input.touch.ts

@@ -27,7 +27,7 @@ module BABYLON {
 
 
                 this._pointerInput = (p, s) => {
                 this._pointerInput = (p, s) => {
                     var evt = <PointerEvent>p.event;
                     var evt = <PointerEvent>p.event;
-                    if (p.type === PointerEventType.PointerDown) {
+                    if (p.type === PointerEventTypes.POINTERDOWN) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -49,7 +49,7 @@ module BABYLON {
                         };
                         };
                     }
                     }
 
 
-                    else if (p.type === PointerEventType.PointerUp) {
+                    else if (p.type === PointerEventTypes.POINTERUP) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -74,7 +74,7 @@ module BABYLON {
                         this._offsetY = null;
                         this._offsetY = null;
                     }
                     }
 
 
-                    else if (p.type === PointerEventType.PointerMove) {
+                    else if (p.type === PointerEventTypes.POINTERMOVE) {
                         if (evt.pointerType === "mouse") {
                         if (evt.pointerType === "mouse") {
                             return;
                             return;
                         }
                         }
@@ -99,6 +99,8 @@ module BABYLON {
                 }
                 }
             }
             }
 
 
+            this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, PointerEventTypes.POINTERDOWN | PointerEventTypes.POINTERUP | PointerEventTypes.POINTERMOVE);
+
             element.addEventListener("blur", this._onLostFocus);
             element.addEventListener("blur", this._onLostFocus);
         }
         }
 
 

+ 1 - 1
src/Debug/babylon.debugLayer.js

@@ -674,6 +674,6 @@ var BABYLON;
             }
             }
         };
         };
         return DebugLayer;
         return DebugLayer;
-    }());
+    })();
     BABYLON.DebugLayer = DebugLayer;
     BABYLON.DebugLayer = DebugLayer;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.js

@@ -147,6 +147,6 @@ var BABYLON;
             }
             }
         };
         };
         return PostProcessRenderEffect;
         return PostProcessRenderEffect;
-    }());
+    })();
     BABYLON.PostProcessRenderEffect = PostProcessRenderEffect;
     BABYLON.PostProcessRenderEffect = PostProcessRenderEffect;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.js

@@ -124,6 +124,6 @@ var BABYLON;
         PostProcessRenderPipeline.PASS_EFFECT_NAME = "passEffect";
         PostProcessRenderPipeline.PASS_EFFECT_NAME = "passEffect";
         PostProcessRenderPipeline.PASS_SAMPLER_NAME = "passSampler";
         PostProcessRenderPipeline.PASS_SAMPLER_NAME = "passSampler";
         return PostProcessRenderPipeline;
         return PostProcessRenderPipeline;
-    }());
+    })();
     BABYLON.PostProcessRenderPipeline = PostProcessRenderPipeline;
     BABYLON.PostProcessRenderPipeline = PostProcessRenderPipeline;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.js

@@ -62,6 +62,6 @@ var BABYLON;
             }
             }
         };
         };
         return PostProcessRenderPipelineManager;
         return PostProcessRenderPipelineManager;
-    }());
+    })();
     BABYLON.PostProcessRenderPipelineManager = PostProcessRenderPipelineManager;
     BABYLON.PostProcessRenderPipelineManager = PostProcessRenderPipelineManager;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 9 - 5
src/Tools/babylon.observable.ts

@@ -13,7 +13,7 @@
     }
     }
 
 
     export class Observer<T> {
     export class Observer<T> {
-        constructor(public callback: (eventData: T, eventState: EventState) => void) {
+        constructor(public callback: (eventData: T, eventState: EventState) => void, public mask:number) {
         }
         }
     }
     }
 
 
@@ -23,14 +23,15 @@
         /**
         /**
          * Create a new Observer with the specified callback
          * Create a new Observer with the specified callback
          * @param callback the callback that will be executed for that Observer
          * @param callback the callback that will be executed for that Observer
+         * @param mash the mask used to filter observers
          * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
          * @param insertFirst if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
          */
          */
-        public add(callback: (eventData: T, eventState: EventState) => void, insertFirst = false): Observer<T> {
+        public add(callback: (eventData: T, eventState: EventState) => void, mask: number = -1, insertFirst = false): Observer<T> {
             if (!callback) {
             if (!callback) {
                 return null;
                 return null;
             }
             }
 
 
-            var observer = new Observer(callback);
+            var observer = new Observer(callback, mask);
 
 
             if (insertFirst) {
             if (insertFirst) {
                 this._observers.unshift(observer);
                 this._observers.unshift(observer);
@@ -77,12 +78,15 @@
         /**
         /**
          * Notify all Observers by calling their respective callback with the given data
          * Notify all Observers by calling their respective callback with the given data
          * @param eventData
          * @param eventData
+         * @param mask
          */
          */
-        public notifyObservers(eventData: T): void {
+        public notifyObservers(eventData: T, mask:number = -1): void {
             var state = new EventState();
             var state = new EventState();
 
 
             for (var obs of this._observers) {
             for (var obs of this._observers) {
-                obs.callback(eventData, state);
+                if (obs.mask & mask) {
+                    obs.callback(eventData, state);
+                }
                 if (state.skipNextObervers) {
                 if (state.skipNextObervers) {
                     break;
                     break;
                 }
                 }

+ 2 - 2
src/babylon.engine.js

@@ -103,7 +103,7 @@ var BABYLON;
         function EngineCapabilities() {
         function EngineCapabilities() {
         }
         }
         return EngineCapabilities;
         return EngineCapabilities;
-    }());
+    })();
     BABYLON.EngineCapabilities = EngineCapabilities;
     BABYLON.EngineCapabilities = EngineCapabilities;
     /**
     /**
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
      * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
@@ -1940,6 +1940,6 @@ var BABYLON;
         Engine.CodeRepository = "src/";
         Engine.CodeRepository = "src/";
         Engine.ShadersRepository = "src/Shaders/";
         Engine.ShadersRepository = "src/Shaders/";
         return Engine;
         return Engine;
-    }());
+    })();
     BABYLON.Engine = Engine;
     BABYLON.Engine = Engine;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 1 - 1
src/babylon.node.js

@@ -293,6 +293,6 @@ var BABYLON;
             BABYLON.serialize()
             BABYLON.serialize()
         ], Node.prototype, "state", void 0);
         ], Node.prototype, "state", void 0);
         return Node;
         return Node;
-    }());
+    })();
     BABYLON.Node = Node;
     BABYLON.Node = Node;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 61 - 11
src/babylon.scene.js

@@ -1,8 +1,54 @@
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    var PointerEventTypes = (function () {
+        function PointerEventTypes() {
+        }
+        Object.defineProperty(PointerEventTypes, "POINTERDOWN", {
+            get: function () {
+                return PointerEventTypes._POINTERDOWN;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERUP", {
+            get: function () {
+                return PointerEventTypes._POINTERUP;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERMOVE", {
+            get: function () {
+                return PointerEventTypes._POINTERMOVE;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERWHEEL", {
+            get: function () {
+                return PointerEventTypes._POINTERWHEEL;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(PointerEventTypes, "POINTERPICK", {
+            get: function () {
+                return PointerEventTypes._POINTERPICK;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        PointerEventTypes._POINTERDOWN = 0x01;
+        PointerEventTypes._POINTERUP = 0x02;
+        PointerEventTypes._POINTERMOVE = 0x04;
+        PointerEventTypes._POINTERWHEEL = 0x08;
+        PointerEventTypes._POINTERPICK = 0x10;
+        return PointerEventTypes;
+    })();
+    BABYLON.PointerEventTypes = PointerEventTypes;
     /**
     /**
      * This type contains all the data related to a pointer event in Babylon.js.
      * This type contains all the data related to a pointer event in Babylon.js.
-     * The event member is an instnce of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel
+     * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The differents event types can be found in the PointerEventTypes class.
      */
      */
     var PointerInfo = (function () {
     var PointerInfo = (function () {
         function PointerInfo(type, event, pickInfo) {
         function PointerInfo(type, event, pickInfo) {
@@ -11,7 +57,7 @@ var BABYLON;
             this.pickInfo = pickInfo;
             this.pickInfo = pickInfo;
         }
         }
         return PointerInfo;
         return PointerInfo;
-    }());
+    })();
     BABYLON.PointerInfo = PointerInfo;
     BABYLON.PointerInfo = PointerInfo;
     /**
     /**
      * Represents a scene to be rendered by the engine.
      * Represents a scene to be rendered by the engine.
@@ -508,8 +554,9 @@ var BABYLON;
                     _this.onPointerMove(evt, pickResult);
                     _this.onPointerMove(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(evt.type === "mousewheel" ? 4 /* PointerWheel */ : 3 /* PointerMove */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = evt.type === "mousewheel" ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
             };
             };
             this._onPointerDown = function (evt) {
             this._onPointerDown = function (evt) {
@@ -565,8 +612,9 @@ var BABYLON;
                     _this.onPointerDown(evt, pickResult);
                     _this.onPointerDown(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(1 /* PointerDown */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = PointerEventTypes.POINTERDOWN;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
                 // Sprites
                 // Sprites
                 _this._pickedDownSprite = null;
                 _this._pickedDownSprite = null;
@@ -609,8 +657,9 @@ var BABYLON;
                             _this.onPointerPick(evt, pickResult);
                             _this.onPointerPick(evt, pickResult);
                         }
                         }
                         if (_this.onPointerObservable.hasObservers()) {
                         if (_this.onPointerObservable.hasObservers()) {
-                            var pi = new PointerInfo(5 /* PointerPick */, evt, pickResult);
-                            _this.onPointerObservable.notifyObservers(pi);
+                            var type = PointerEventTypes.POINTERPICK;
+                            var pi = new PointerInfo(type, evt, pickResult);
+                            _this.onPointerObservable.notifyObservers(pi, type);
                         }
                         }
                     }
                     }
                     if (pickResult.pickedMesh.actionManager) {
                     if (pickResult.pickedMesh.actionManager) {
@@ -627,8 +676,9 @@ var BABYLON;
                     _this.onPointerUp(evt, pickResult);
                     _this.onPointerUp(evt, pickResult);
                 }
                 }
                 if (_this.onPointerObservable.hasObservers()) {
                 if (_this.onPointerObservable.hasObservers()) {
-                    var pi = new PointerInfo(2 /* PointerUp */, evt, pickResult);
-                    _this.onPointerObservable.notifyObservers(pi);
+                    var type = PointerEventTypes.POINTERUP;
+                    var pi = new PointerInfo(type, evt, pickResult);
+                    _this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
                 _this._startingPointerTime = 0;
                 _this._startingPointerTime = 0;
                 // Sprites
                 // Sprites
@@ -2244,6 +2294,6 @@ var BABYLON;
         Scene.MinDeltaTime = 1.0;
         Scene.MinDeltaTime = 1.0;
         Scene.MaxDeltaTime = 1000.0;
         Scene.MaxDeltaTime = 1000.0;
         return Scene;
         return Scene;
-    }());
+    })();
     BABYLON.Scene = Scene;
     BABYLON.Scene = Scene;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));

+ 40 - 15
src/babylon.scene.ts

@@ -3,19 +3,40 @@
         dispose(): void;
         dispose(): void;
     }
     }
 
 
-    /**
-     * Different type of pointer event, enumerations are self explanatory
-     */
-    export const enum PointerEventType {
-        None, PointerDown, PointerUp, PointerMove, PointerWheel, PointerPick
+    export class PointerEventTypes {
+        static _POINTERDOWN  = 0x01;
+        static _POINTERUP    = 0x02;
+        static _POINTERMOVE  = 0x04;
+        static _POINTERWHEEL = 0x08;
+        static _POINTERPICK  = 0x10;
+
+        public static get POINTERDOWN() : number {
+            return PointerEventTypes._POINTERDOWN;
+        }
+
+        public static get POINTERUP(): number {
+            return PointerEventTypes._POINTERUP;
+        }
+
+        public static get POINTERMOVE(): number {
+            return PointerEventTypes._POINTERMOVE;
+        }
+
+        public static get POINTERWHEEL(): number {
+            return PointerEventTypes._POINTERWHEEL;
+        }
+
+        public static get POINTERPICK(): number {
+            return PointerEventTypes._POINTERPICK;
+        }
     }
     }
 
 
     /**
     /**
      * This type contains all the data related to a pointer event in Babylon.js.
      * This type contains all the data related to a pointer event in Babylon.js.
-     * The event member is an instnce of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel
+     * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The differents event types can be found in the PointerEventTypes class.
      */
      */
     export class PointerInfo {
     export class PointerInfo {
-        constructor(public type: PointerEventType, public event: PointerEvent | MouseWheelEvent, public pickInfo: PickingInfo) {
+        constructor(public type: number, public event: PointerEvent | MouseWheelEvent, public pickInfo: PickingInfo) {
         }
         }
     }
     }
 
 
@@ -660,8 +681,9 @@
                 }
                 }
 
 
                 if (this.onPointerObservable.hasObservers()) {
                 if (this.onPointerObservable.hasObservers()) {
-                    let pi = new PointerInfo(evt.type === "mousewheel" ? PointerEventType.PointerWheel : PointerEventType.PointerMove, evt, pickResult);
-                    this.onPointerObservable.notifyObservers(pi);
+                    let type = evt.type === "mousewheel" ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE;
+                    let pi = new PointerInfo(type, evt, pickResult);
+                    this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
             };
             };
 
 
@@ -728,8 +750,9 @@
                 }
                 }
 
 
                 if (this.onPointerObservable.hasObservers()) {
                 if (this.onPointerObservable.hasObservers()) {
-                    let pi = new PointerInfo(PointerEventType.PointerDown, evt, pickResult);
-                    this.onPointerObservable.notifyObservers(pi);
+                    let type = PointerEventTypes.POINTERDOWN;
+                    let pi = new PointerInfo(type, evt, pickResult);
+                    this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
 
 
                 // Sprites
                 // Sprites
@@ -779,8 +802,9 @@
                             this.onPointerPick(evt, pickResult);
                             this.onPointerPick(evt, pickResult);
                         }
                         }
                         if (this.onPointerObservable.hasObservers()) {
                         if (this.onPointerObservable.hasObservers()) {
-                            let pi = new PointerInfo(PointerEventType.PointerPick, evt, pickResult);
-                            this.onPointerObservable.notifyObservers(pi);
+                            let type = PointerEventTypes.POINTERPICK;
+                            let pi = new PointerInfo(type, evt, pickResult);
+                            this.onPointerObservable.notifyObservers(pi, type);
                         }
                         }
                     }
                     }
                     if (pickResult.pickedMesh.actionManager) {
                     if (pickResult.pickedMesh.actionManager) {
@@ -800,8 +824,9 @@
                 }
                 }
 
 
                 if (this.onPointerObservable.hasObservers()) {
                 if (this.onPointerObservable.hasObservers()) {
-                    let pi = new PointerInfo(PointerEventType.PointerUp, evt, pickResult);
-                    this.onPointerObservable.notifyObservers(pi);
+                    let type = PointerEventTypes.POINTERUP;
+                    let pi = new PointerInfo(type, evt, pickResult);
+                    this.onPointerObservable.notifyObservers(pi, type);
                 }
                 }
 
 
                 this._startingPointerTime = 0;
                 this._startingPointerTime = 0;