David Catuhe 10 роки тому
батько
коміт
a20a5bd7ed

+ 25 - 0
Babylon/Actions/babylon.actionManager.js

@@ -134,6 +134,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(ActionManager, "OnPickUpTrigger", {
+            get: function () {
+                return ActionManager._OnPickUpTrigger;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         ActionManager.prototype.dispose = function () {
             var index = this._scene._actionManagers.indexOf(this);
@@ -158,6 +165,20 @@ var BABYLON;
             }
             return false;
         };
+        /**
+         * Does this action manager handles actions of a given trigger
+         * @param {number} trigger - the trigger to be tested
+         * @return {boolean} whether the trigger is handeled
+         */
+        ActionManager.prototype.hasSpecificTrigger = function (trigger) {
+            for (var index = 0; index < this.actions.length; index++) {
+                var action = this.actions[index];
+                if (action.trigger === trigger) {
+                    return true;
+                }
+            }
+            return false;
+        };
         Object.defineProperty(ActionManager.prototype, "hasPointerTriggers", {
             /**
              * Does this action manager has pointer triggers
@@ -169,6 +190,9 @@ var BABYLON;
                     if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) {
                         return true;
                     }
+                    if (action.trigger == ActionManager._OnPickUpTrigger) {
+                        return true;
+                    }
                 }
                 return false;
             },
@@ -256,6 +280,7 @@ var BABYLON;
         ActionManager._OnIntersectionExitTrigger = 9;
         ActionManager._OnKeyDownTrigger = 10;
         ActionManager._OnKeyUpTrigger = 11;
+        ActionManager._OnPickUpTrigger = 12;
         return ActionManager;
     })();
     BABYLON.ActionManager = ActionManager;

+ 24 - 0
Babylon/Actions/babylon.actionManager.ts

@@ -54,6 +54,7 @@
         private static _OnIntersectionExitTrigger = 9;
         private static _OnKeyDownTrigger = 10;
         private static _OnKeyUpTrigger = 11;
+        private static _OnPickUpTrigger = 12;
 
         public static get NothingTrigger(): number {
             return ActionManager._NothingTrigger;
@@ -102,6 +103,9 @@
         public static get OnKeyUpTrigger(): number {
             return ActionManager._OnKeyUpTrigger;
         }
+        public static get OnPickUpTrigger(): number {
+            return ActionManager._OnPickUpTrigger;
+        }
         // Members
         public actions = new Array<Action>();
 
@@ -144,6 +148,23 @@
         }
 
         /**
+         * Does this action manager handles actions of a given trigger
+         * @param {number} trigger - the trigger to be tested
+         * @return {boolean} whether the trigger is handeled 
+         */
+        public hasSpecificTrigger(trigger: number): boolean {
+            for (var index = 0; index < this.actions.length; index++) {
+                var action = this.actions[index];
+
+                if (action.trigger === trigger) {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        /**
          * Does this action manager has pointer triggers
          * @return {boolean} whether or not it has pointer triggers
          */
@@ -154,6 +175,9 @@
                 if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) {
                     return true;
                 }
+                if (action.trigger == ActionManager._OnPickUpTrigger) {
+                    return true;
+                }
             }
 
             return false;

+ 15 - 11
Babylon/Cameras/babylon.camera.js

@@ -226,21 +226,25 @@ var BABYLON;
         Camera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
-        Camera.prototype.getViewMatrix = function () {
-            this._computedViewMatrix = this._computeViewMatrix();
-            if (!this.parent || !this.parent.getWorldMatrix || this.isSynchronized()) {
-                this._globalPosition.copyFrom(this.position);
+        Camera.prototype.getViewMatrix = function (force) {
+            this._computedViewMatrix = this._computeViewMatrix(force);
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
-            if (!this._worldMatrix) {
-                this._worldMatrix = BABYLON.Matrix.Identity();
+            if (!this.parent || !this.parent.getWorldMatrix) {
+                this._globalPosition.copyFrom(this.position);
+            }
+            else {
+                if (!this._worldMatrix) {
+                    this._worldMatrix = BABYLON.Matrix.Identity();
+                }
+                this._computedViewMatrix.invertToRef(this._worldMatrix);
+                this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
+                this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
+                this._computedViewMatrix.invert();
+                this._markSyncedWithParent();
             }
-            this._computedViewMatrix.invertToRef(this._worldMatrix);
-            this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
-            this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
-            this._computedViewMatrix.invert();
             this._currentRenderId = this.getScene().getRenderId();
-            this._markSyncedWithParent();
             return this._computedViewMatrix;
         };
         Camera.prototype._computeViewMatrix = function (force) {

+ 16 - 17
Babylon/Cameras/babylon.camera.ts

@@ -281,32 +281,31 @@
             return Matrix.Identity();
         }
 
-        public getViewMatrix(): Matrix {
-            this._computedViewMatrix = this._computeViewMatrix();
-
-            if (!this.parent
-                || !this.parent.getWorldMatrix
-                || this.isSynchronized()) {
-
-                this._globalPosition.copyFrom(this.position);
+        public getViewMatrix(force?: boolean): Matrix {
+            this._computedViewMatrix = this._computeViewMatrix(force);
 
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
 
-            if (!this._worldMatrix) {
-                this._worldMatrix = Matrix.Identity();
-            }
+            if (!this.parent || !this.parent.getWorldMatrix) {
+                this._globalPosition.copyFrom(this.position);
+            } else {
+                if (!this._worldMatrix) {
+                    this._worldMatrix = Matrix.Identity();
+                }
 
-            this._computedViewMatrix.invertToRef(this._worldMatrix);
+                this._computedViewMatrix.invertToRef(this._worldMatrix);
 
-            this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
-            this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
+                this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
+                this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
 
-            this._computedViewMatrix.invert();
+                this._computedViewMatrix.invert();
 
-            this._currentRenderId = this.getScene().getRenderId();
+                this._markSyncedWithParent();
+            }
 
-            this._markSyncedWithParent();
+            this._currentRenderId = this.getScene().getRenderId();
 
             return this._computedViewMatrix;
         }

+ 2 - 1
Babylon/Mesh/babylon.mesh.js

@@ -47,7 +47,7 @@ var BABYLON;
                     source._geometry.applyToMesh(this);
                 }
                 // Deep copy
-                BABYLON.Tools.DeepCopy(source, this, ["name", "material", "skeleton"], []);
+                BABYLON.Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances"], []);
                 // Material
                 this.material = source.material;
                 if (!doNotCloneChildren) {
@@ -732,6 +732,7 @@ var BABYLON;
                 return;
             }
             data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
+            temp = [];
             for (index = 0; index < data.length; index += 3) {
                 BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).toArray(temp, index);
             }

+ 9 - 8
Babylon/Mesh/babylon.mesh.ts

@@ -72,7 +72,7 @@
                 }
 
                 // Deep copy
-                Tools.DeepCopy(source, this, ["name", "material", "skeleton"], []);
+                Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances"], []);
 
                 // Material
                 this.material = source.material;
@@ -525,11 +525,11 @@
             }
         }
 
-        public registerAfterRender(func: () => void): void {
+        public registerAfterRender(func: (mesh: AbstractMesh) => void): void {
             this._onAfterRenderCallbacks.push(func);
         }
 
-        public unregisterAfterRender(func: () => void): void {
+        public unregisterAfterRender(func: (mesh: AbstractMesh) => void): void {
             var index = this._onAfterRenderCallbacks.indexOf(func);
 
             if (index > -1) {
@@ -875,6 +875,7 @@
             }
 
             data = this.getVerticesData(VertexBuffer.NormalKind);
+            temp = [];
             for (index = 0; index < data.length; index += 3) {
                 Vector3.TransformNormal(Vector3.FromArray(data, index), transform).toArray(temp, index);
             }
@@ -1216,13 +1217,13 @@
         }
 
         public static CreateDisc(name: string, radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
-           var disc = new Mesh(name, scene);
-           var vertexData = VertexData.CreateDisc(radius, tessellation, sideOrientation);
+            var disc = new Mesh(name, scene);
+            var vertexData = VertexData.CreateDisc(radius, tessellation, sideOrientation);
 
-           vertexData.applyToMesh(disc, updatable);
+            vertexData.applyToMesh(disc, updatable);
 
-           return disc;
-       }
+            return disc;
+        }
 
         public static CreateBox(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
             var box = new Mesh(name, scene);

+ 3 - 3
Babylon/Mesh/babylon.polygonmesh.js

@@ -136,9 +136,9 @@ var BABYLON;
                     indices.push(point.index);
                 });
             });
-            result.setVerticesData(positions, BABYLON.VertexBuffer.PositionKind, updatable);
-            result.setVerticesData(normals, BABYLON.VertexBuffer.NormalKind, updatable);
-            result.setVerticesData(uvs, BABYLON.VertexBuffer.UVKind, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs, updatable);
             result.setIndices(indices);
             return result;
         };

+ 3 - 3
Babylon/Mesh/babylon.polygonmesh.ts

@@ -152,9 +152,9 @@
                 });
             });
 
-            result.setVerticesData(positions, VertexBuffer.PositionKind, updatable);
-            result.setVerticesData(normals, VertexBuffer.NormalKind, updatable);
-            result.setVerticesData(uvs, VertexBuffer.UVKind, updatable);
+            result.setVerticesData(VertexBuffer.PositionKind, positions, updatable);
+            result.setVerticesData(VertexBuffer.NormalKind, normals, updatable);
+            result.setVerticesData(VertexBuffer.UVKind, uvs, updatable);
             result.setIndices(indices);
 
             return result;

+ 7 - 0
Babylon/babylon.engine.js

@@ -785,6 +785,13 @@ var BABYLON;
             this._renderingCanvas.width = width;
             this._renderingCanvas.height = height;
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+                    cam._currentRenderId = 0;
+                }
+            }
         };
         Engine.prototype.bindFramebuffer = function (texture) {
             this._currentRenderTarget = texture;

+ 10 - 0
Babylon/babylon.engine.ts

@@ -914,6 +914,16 @@
             this._renderingCanvas.height = height;
 
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+
+                    cam._currentRenderId = 0;
+                }
+            }
         }
 
         public bindFramebuffer(texture: WebGLTexture): void {

+ 20 - 0
Babylon/babylon.scene.js

@@ -324,6 +324,24 @@ var BABYLON;
                     _this.onPointerDown(evt, pickResult);
                 }
             };
+            this._onPointerUp = function (evt) {
+                var predicate = null;
+                if (!_this.onPointerUp) {
+                    predicate = function (mesh) {
+                        return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnPickUpTrigger);
+                    };
+                }
+                _this._updatePointerPosition(evt);
+                var pickResult = _this.pick(_this._pointerX, _this._pointerY, predicate, false, _this.cameraToUseForPointers);
+                if (pickResult.hit) {
+                    if (pickResult.pickedMesh.actionManager) {
+                        pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt));
+                    }
+                }
+                if (_this.onPointerUp) {
+                    _this.onPointerUp(evt, pickResult);
+                }
+            };
             this._onKeyDown = function (evt) {
                 if (_this.actionManager) {
                     _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyDownTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt));
@@ -337,6 +355,7 @@ var BABYLON;
             var eventPrefix = BABYLON.Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "move", this._onPointerMove, false);
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "down", this._onPointerDown, false);
+            this._engine.getRenderingCanvas().addEventListener(eventPrefix + "up", this._onPointerUp, false);
             BABYLON.Tools.RegisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },
                 { name: "keyup", handler: this._onKeyUp }
@@ -346,6 +365,7 @@ var BABYLON;
             var eventPrefix = BABYLON.Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "move", this._onPointerMove);
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "down", this._onPointerDown);
+            this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "up", this._onPointerUp);
             BABYLON.Tools.UnregisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },
                 { name: "keyup", handler: this._onKeyUp }

+ 28 - 0
Babylon/babylon.scene.ts

@@ -63,7 +63,9 @@
         // Pointers
         private _onPointerMove: (evt: PointerEvent) => void;
         private _onPointerDown: (evt: PointerEvent) => void;
+        private _onPointerUp: (evt: PointerEvent) => void;
         public onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        public onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void;
         public cameraToUseForPointers: Camera = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position
         private _pointerX: number;
         private _pointerY: number;
@@ -465,6 +467,30 @@
                     this.onPointerDown(evt, pickResult);
                 }
             };
+            this._onPointerUp = (evt: PointerEvent) => {
+
+                var predicate = null;
+
+                if (!this.onPointerUp) {
+                    predicate = (mesh: AbstractMesh): boolean => {
+                        return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(ActionManager.OnPickUpTrigger);
+                    };
+                }
+
+                this._updatePointerPosition(evt);
+
+                var pickResult = this.pick(this._pointerX, this._pointerY, predicate, false, this.cameraToUseForPointers);
+
+                if (pickResult.hit) {
+                    if (pickResult.pickedMesh.actionManager) {
+                        pickResult.pickedMesh.actionManager.processTrigger(ActionManager.OnPickUpTrigger, ActionEvent.CreateNew(pickResult.pickedMesh, evt));
+                    }
+                }
+
+                if (this.onPointerUp) {
+                    this.onPointerUp(evt, pickResult);
+                }
+            };
 
             this._onKeyDown = (evt: Event) => {
                 if (this.actionManager) {
@@ -482,6 +508,7 @@
             var eventPrefix = Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "move", this._onPointerMove, false);
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "down", this._onPointerDown, false);
+            this._engine.getRenderingCanvas().addEventListener(eventPrefix + "up", this._onPointerUp, false);
 
             Tools.RegisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },
@@ -493,6 +520,7 @@
             var eventPrefix = Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "move", this._onPointerMove);
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "down", this._onPointerDown);
+            this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "up", this._onPointerUp);
 
             Tools.UnregisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },

+ 72 - 18
babylon.2.1-beta.debug.js

@@ -4444,6 +4444,13 @@ var __extends = this.__extends || function (d, b) {
             this._renderingCanvas.width = width;
             this._renderingCanvas.height = height;
             this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
+            for (var index = 0; index < this.scenes.length; index++) {
+                var scene = this.scenes[index];
+                for (var camIndex = 0; camIndex < scene.cameras.length; camIndex++) {
+                    var cam = scene.cameras[camIndex];
+                    cam._currentRenderId = 0;
+                }
+            }
         };
         Engine.prototype.bindFramebuffer = function (texture) {
             this._currentRenderTarget = texture;
@@ -7026,9 +7033,6 @@ var BABYLON;
             this._update();
         };
         // Synchronized
-        //public isSynchronizedWithParent(): boolean {
-        //    return false;
-        //}
         Camera.prototype._isSynchronized = function () {
             return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();
         };
@@ -7135,21 +7139,25 @@ var BABYLON;
         Camera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
-        Camera.prototype.getViewMatrix = function () {
-            this._computedViewMatrix = this._computeViewMatrix();
-            if (!this.parent || !this.parent.getWorldMatrix || this.isSynchronized()) {
-                this._globalPosition.copyFrom(this.position);
+        Camera.prototype.getViewMatrix = function (force) {
+            this._computedViewMatrix = this._computeViewMatrix(force);
+            if (!force && this._isSynchronizedViewMatrix()) {
                 return this._computedViewMatrix;
             }
-            if (!this._worldMatrix) {
-                this._worldMatrix = BABYLON.Matrix.Identity();
+            if (!this.parent || !this.parent.getWorldMatrix) {
+                this._globalPosition.copyFrom(this.position);
+            }
+            else {
+                if (!this._worldMatrix) {
+                    this._worldMatrix = BABYLON.Matrix.Identity();
+                }
+                this._computedViewMatrix.invertToRef(this._worldMatrix);
+                this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
+                this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
+                this._computedViewMatrix.invert();
+                this._markSyncedWithParent();
             }
-            this._computedViewMatrix.invertToRef(this._worldMatrix);
-            this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._computedViewMatrix);
-            this._globalPosition.copyFromFloats(this._computedViewMatrix.m[12], this._computedViewMatrix.m[13], this._computedViewMatrix.m[14]);
-            this._computedViewMatrix.invert();
             this._currentRenderId = this.getScene().getRenderId();
-            this._markSyncedWithParent();
             return this._computedViewMatrix;
         };
         Camera.prototype._computeViewMatrix = function (force) {
@@ -8516,6 +8524,24 @@ var BABYLON;
                     _this.onPointerDown(evt, pickResult);
                 }
             };
+            this._onPointerUp = function (evt) {
+                var predicate = null;
+                if (!_this.onPointerUp) {
+                    predicate = function (mesh) {
+                        return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnPickUpTrigger);
+                    };
+                }
+                _this._updatePointerPosition(evt);
+                var pickResult = _this.pick(_this._pointerX, _this._pointerY, predicate, false, _this.cameraToUseForPointers);
+                if (pickResult.hit) {
+                    if (pickResult.pickedMesh.actionManager) {
+                        pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt));
+                    }
+                }
+                if (_this.onPointerUp) {
+                    _this.onPointerUp(evt, pickResult);
+                }
+            };
             this._onKeyDown = function (evt) {
                 if (_this.actionManager) {
                     _this.actionManager.processTrigger(BABYLON.ActionManager.OnKeyDownTrigger, BABYLON.ActionEvent.CreateNewFromScene(_this, evt));
@@ -8529,6 +8555,7 @@ var BABYLON;
             var eventPrefix = BABYLON.Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "move", this._onPointerMove, false);
             this._engine.getRenderingCanvas().addEventListener(eventPrefix + "down", this._onPointerDown, false);
+            this._engine.getRenderingCanvas().addEventListener(eventPrefix + "up", this._onPointerUp, false);
             BABYLON.Tools.RegisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },
                 { name: "keyup", handler: this._onKeyUp }
@@ -8538,6 +8565,7 @@ var BABYLON;
             var eventPrefix = BABYLON.Tools.GetPointerPrefix();
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "move", this._onPointerMove);
             this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "down", this._onPointerDown);
+            this._engine.getRenderingCanvas().removeEventListener(eventPrefix + "up", this._onPointerUp);
             BABYLON.Tools.UnregisterTopRootEvents([
                 { name: "keydown", handler: this._onKeyDown },
                 { name: "keyup", handler: this._onKeyUp }
@@ -10910,7 +10938,7 @@ var BABYLON;
                     source._geometry.applyToMesh(this);
                 }
                 // Deep copy
-                BABYLON.Tools.DeepCopy(source, this, ["name", "material", "skeleton"], []);
+                BABYLON.Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances"], []);
                 // Material
                 this.material = source.material;
                 if (!doNotCloneChildren) {
@@ -11595,6 +11623,7 @@ var BABYLON;
                 return;
             }
             data = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
+            temp = [];
             for (index = 0; index < data.length; index += 3) {
                 BABYLON.Vector3.TransformNormal(BABYLON.Vector3.FromArray(data, index), transform).toArray(temp, index);
             }
@@ -25045,6 +25074,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(ActionManager, "OnPickUpTrigger", {
+            get: function () {
+                return ActionManager._OnPickUpTrigger;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         ActionManager.prototype.dispose = function () {
             var index = this._scene._actionManagers.indexOf(this);
@@ -25069,6 +25105,20 @@ var BABYLON;
             }
             return false;
         };
+        /**
+         * Does this action manager handles actions of a given trigger
+         * @param {number} trigger - the trigger to be tested
+         * @return {boolean} whether the trigger is handeled
+         */
+        ActionManager.prototype.hasSpecificTrigger = function (trigger) {
+            for (var index = 0; index < this.actions.length; index++) {
+                var action = this.actions[index];
+                if (action.trigger === trigger) {
+                    return true;
+                }
+            }
+            return false;
+        };
         Object.defineProperty(ActionManager.prototype, "hasPointerTriggers", {
             /**
              * Does this action manager has pointer triggers
@@ -25080,6 +25130,9 @@ var BABYLON;
                     if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) {
                         return true;
                     }
+                    if (action.trigger == ActionManager._OnPickUpTrigger) {
+                        return true;
+                    }
                 }
                 return false;
             },
@@ -25167,6 +25220,7 @@ var BABYLON;
         ActionManager._OnIntersectionExitTrigger = 9;
         ActionManager._OnKeyDownTrigger = 10;
         ActionManager._OnKeyUpTrigger = 11;
+        ActionManager._OnPickUpTrigger = 12;
         return ActionManager;
     })();
     BABYLON.ActionManager = ActionManager;
@@ -28735,9 +28789,9 @@ var BABYLON;
                     indices.push(point.index);
                 });
             });
-            result.setVerticesData(positions, BABYLON.VertexBuffer.PositionKind, updatable);
-            result.setVerticesData(normals, BABYLON.VertexBuffer.NormalKind, updatable);
-            result.setVerticesData(uvs, BABYLON.VertexBuffer.UVKind, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable);
+            result.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs, updatable);
             result.setIndices(indices);
             return result;
         };

Різницю між файлами не показано, бо вона завелика
+ 24 - 23
babylon.2.1-beta.js