David Catuhe 10 rokov pred
rodič
commit
a70a574fb9

+ 8 - 4
Babylon/Audio/babylon.sound.js

@@ -110,15 +110,19 @@ var BABYLON;
                 else {
                     this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
                 }
-                this._soundGain.disconnect();
-                this._soundSource.disconnect();
+                if (this._soundGain) {
+                    this._soundGain.disconnect();
+                    this._soundGain = null;
+                }
                 if (this._soundPanner) {
                     this._soundPanner.disconnect();
                     this._soundPanner = null;
                 }
+                if (this._soundSource) {
+                    this._soundSource.disconnect();
+                    this._soundSource = null;
+                }
                 this._audioBuffer = null;
-                this._soundGain = null;
-                this._soundSource = null;
                 if (this._connectedMesh) {
                     this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
                     this._connectedMesh = null;

+ 9 - 4
Babylon/Audio/babylon.sound.ts

@@ -123,15 +123,20 @@
                 else {
                     this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
                 }
-                this._soundGain.disconnect();
-                this._soundSource.disconnect();
+                if (this._soundGain) {
+                    this._soundGain.disconnect();
+                    this._soundGain = null;
+                }
                 if (this._soundPanner) {
                     this._soundPanner.disconnect();
                     this._soundPanner = null;
                 }
+                if (this._soundSource) {
+                    this._soundSource.disconnect();
+                    this._soundSource = null;
+                }
                 this._audioBuffer = null;
-                this._soundGain = null;
-                this._soundSource = null;
+
                 if (this._connectedMesh) {
                     this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
                     this._connectedMesh = null;

+ 2 - 0
Babylon/Loading/Plugins/babylon.babylonFileLoader.js

@@ -689,6 +689,8 @@ var BABYLON;
             };
             // traverse graph per trigger
             var traverse = function (parsedAction, trigger, condition, action) {
+                if (parsedAction.detached)
+                    return;
                 var parameters = new Array();
                 var target = null;
                 var propertyPath = null;

+ 3 - 0
Babylon/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -871,6 +871,9 @@
 
         // traverse graph per trigger
         var traverse = (parsedAction: any, trigger: any, condition: Condition, action: Action) => {
+            if (parsedAction.detached)
+                return;
+
             var parameters = new Array<any>();
             var target: any = null;
             var propertyPath: string = null;

+ 2 - 2
Babylon/Materials/Textures/babylon.cubeTexture.js

@@ -32,7 +32,7 @@ var BABYLON;
             this._textureMatrix = BABYLON.Matrix.Identity();
         }
         CubeTexture.prototype.clone = function () {
-            var newTexture = new BABYLON.CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
+            var newTexture = new CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
             // Base texture
             newTexture.level = this.level;
             newTexture.wrapU = this.wrapU;
@@ -43,7 +43,7 @@ var BABYLON;
         };
         // Methods
         CubeTexture.prototype.delayLoad = function () {
-            if (this.delayLoadState != BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
+            if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
             }
             this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED;

+ 6 - 6
Babylon/Materials/Textures/babylon.cubeTexture.ts

@@ -1,7 +1,7 @@
 module BABYLON {
     export class CubeTexture extends BaseTexture {
         public url: string;
-        public coordinatesMode = BABYLON.Texture.CUBIC_MODE;
+        public coordinatesMode = Texture.CUBIC_MODE;
 
         private _noMipmap: boolean;
         private _extensions: string[];
@@ -27,17 +27,17 @@
                 if (!scene.useDelayedTextureLoading) {
                     this._texture = scene.getEngine().createCubeTexture(rootUrl, scene, extensions, noMipmap);
                 } else {
-                    this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
+                    this.delayLoadState = Engine.DELAYLOADSTATE_NOTLOADED;
                 }
             }
 
             this.isCube = true;
 
-            this._textureMatrix = BABYLON.Matrix.Identity();
+            this._textureMatrix = Matrix.Identity();
         }
 
         public clone(): CubeTexture {
-            var newTexture = new BABYLON.CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
+            var newTexture = new CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
 
             // Base texture
             newTexture.level = this.level;
@@ -51,11 +51,11 @@
 
         // Methods
         public delayLoad(): void {
-            if (this.delayLoadState != BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
+            if (this.delayLoadState !== Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
             }
 
-            this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED;
+            this.delayLoadState = Engine.DELAYLOADSTATE_LOADED;
             this._texture = this._getFromCache(this.url, this._noMipmap);
 
             if (!this._texture) {

+ 84 - 0
Babylon/Math/babylon.math.js

@@ -2401,5 +2401,89 @@ var BABYLON;
         return Path2;
     })();
     BABYLON.Path2 = Path2;
+    var Path3D = (function () {
+        function Path3D(path) {
+            this.path = path;
+            this._curve = [];
+            this._distances = [];
+            this._tangents = [];
+            this._normals = [];
+            this._binormals = [];
+            this._curve = path.slice(); // copy array         
+            var l = this._curve.length;
+            // first and last tangents
+            this._tangents[0] = this._curve[1].subtract(this._curve[0]);
+            this._tangents[0].normalize();
+            this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]);
+            this._tangents[l - 1].normalize();
+            // normals and binormals at first point : arbitrary vector with _normalVector()
+            var tg0 = this._tangents[0];
+            var pp0 = this._normalVector(this._curve[0], tg0);
+            this._normals[0] = pp0;
+            this._normals[0].normalize();
+            this._binormals[0] = Vector3.Cross(tg0, this._normals[0]);
+            this._normals[0].normalize();
+            this._distances[0] = 0;
+            // normals and binormals : next points
+            var prev; // previous vector (segment)
+            var cur; // current vector (segment)
+            var curTang; // current tangent
+            var prevNorm; // previous normal
+            var prevBinor; // previous binormal
+            for (var i = 1; i < l; i++) {
+                // tangents
+                prev = this._curve[i].subtract(this._curve[i - 1]);
+                if (i < l - 1) {
+                    cur = this._curve[i + 1].subtract(this._curve[i]);
+                    this._tangents[i] = prev.add(cur);
+                    this._tangents[i].normalize();
+                }
+                this._distances[i] = this._distances[i - 1] + prev.length();
+                // normals and binormals
+                // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html
+                curTang = this._tangents[i];
+                prevNorm = this._normals[i - 1];
+                prevBinor = this._binormals[i - 1];
+                this._normals[i] = Vector3.Cross(prevBinor, curTang);
+                this._normals[i].normalize();
+                this._binormals[i] = Vector3.Cross(curTang, this._normals[i]);
+                this._binormals[i].normalize();
+            }
+        }
+        Path3D.prototype.getCurve = function () {
+            return this._curve;
+        };
+        Path3D.prototype.getTangents = function () {
+            return this._tangents;
+        };
+        Path3D.prototype.getNormals = function () {
+            return this._normals;
+        };
+        Path3D.prototype.getBinormals = function () {
+            return this._binormals;
+        };
+        Path3D.prototype.getDistances = function () {
+            return this._distances;
+        };
+        // private function normalVector(v0, vt) :
+        // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane
+        Path3D.prototype._normalVector = function (v0, vt) {
+            var point;
+            if (vt.x !== 1) {
+                point = new Vector3(1, 0, 0);
+            }
+            else if (vt.y !== 1) {
+                point = new Vector3(0, 1, 0);
+            }
+            else if (vt.z !== 1) {
+                point = new Vector3(0, 0, 1);
+            }
+            var normal0 = Vector3.Cross(vt, point);
+            normal0.normalize();
+            return normal0;
+        };
+        return Path3D;
+    })();
+    BABYLON.Path3D = Path3D;
 })(BABYLON || (BABYLON = {}));
 //# sourceMappingURL=babylon.math.js.map

+ 18 - 12
Babylon/Math/babylon.math.ts

@@ -3016,25 +3016,29 @@
         constructor(public path: Vector3[]) {
             this._curve = path.slice();   // copy array         
             var l: number = this._curve.length;
+
             // first and last tangents
             this._tangents[0] = this._curve[1].subtract(this._curve[0]);
             this._tangents[0].normalize();
             this._tangents[l-1] = this._curve[l-1].subtract(this._curve[l-2]);
-            this._tangents[l-1].normalize();
+            this._tangents[l - 1].normalize();
+            
             // normals and binormals at first point : arbitrary vector with _normalVector()
             var tg0: Vector3 = this._tangents[0];
             var pp0: Vector3 = this._normalVector(this._curve[0], tg0);
             this._normals[0] = pp0;
             this._normals[0].normalize();
-            this._binormals[0] = BABYLON.Vector3.Cross(tg0, this._normals[0]);
+            this._binormals[0] = Vector3.Cross(tg0, this._normals[0]);
             this._normals[0].normalize();
             this._distances[0] = 0;
+
             // normals and binormals : next points
             var prev: Vector3;        // previous vector (segment)
             var cur: Vector3;         // current vector (segment)
             var curTang: Vector3;     // current tangent
             var prevNorm: Vector3;    // previous normal
             var prevBinor: Vector3;   // previous binormal
+
             for(var i: number = 1; i < l; i++) {
                 // tangents
                 prev = this._curve[i].subtract(this._curve[i-1]);
@@ -3043,15 +3047,16 @@
                     this._tangents[i] = prev.add(cur);
                     this._tangents[i].normalize();               
                 }
-                this._distances[i] = this._distances[i-1] + prev.length();         
+                this._distances[i] = this._distances[i - 1] + prev.length();   
+                      
                 // normals and binormals
                 // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html
                 curTang = this._tangents[i];
                 prevNorm = this._normals[i-1];
                 prevBinor = this._binormals[i-1];
-                this._normals[i] = BABYLON.Vector3.Cross(prevBinor, curTang);
+                this._normals[i] = Vector3.Cross(prevBinor, curTang);
                 this._normals[i].normalize();
-                this._binormals[i] = BABYLON.Vector3.Cross(curTang, this._normals[i]);
+                this._binormals[i] = Vector3.Cross(curTang, this._normals[i]);
                 this._binormals[i].normalize();
             }
         }
@@ -3080,16 +3085,17 @@
         // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane
         private _normalVector(v0: Vector3, vt: Vector3): Vector3 {
             var point: Vector3; 
-            if (vt.x != 1) {     // search for a point in the plane
-                point = new BABYLON.Vector3(1, 0, 0);   
+
+            if (vt.x !== 1) {     // search for a point in the plane
+                point = new Vector3(1, 0, 0);   
             }
-            else if (vt.y != 1) {
-                point = new BABYLON.Vector3(0, 1, 0);  
+            else if (vt.y !== 1) {
+                point = new Vector3(0, 1, 0);  
             }
-            else if (vt.z != 1) {
-                point = new BABYLON.Vector3(0, 0, 1);  
+            else if (vt.z !== 1) {
+                point = new Vector3(0, 0, 1);  
             }
-            var normal0: Vector3 = BABYLON.Vector3.Cross(vt, point);
+            var normal0: Vector3 = Vector3.Cross(vt, point);
             normal0.normalize();
             return normal0;        
         }

+ 20 - 0
Babylon/Mesh/babylon.geometry.js

@@ -396,6 +396,26 @@ var BABYLON;
                 return _Primitive;
             })(Geometry);
             Primitives._Primitive = _Primitive;
+            var Ribbon = (function (_super) {
+                __extends(Ribbon, _super);
+                function Ribbon(id, scene, pathArray, closeArray, closePath, offset, canBeRegenerated, mesh, side) {
+                    if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; }
+                    this.pathArray = pathArray;
+                    this.closeArray = closeArray;
+                    this.closePath = closePath;
+                    this.offset = offset;
+                    this.side = side;
+                    _super.call(this, id, scene, this._regenerateVertexData(), canBeRegenerated, mesh);
+                }
+                Ribbon.prototype._regenerateVertexData = function () {
+                    return BABYLON.VertexData.CreateRibbon(this.pathArray, this.closeArray, this.closePath, this.offset, this.side);
+                };
+                Ribbon.prototype.copy = function (id) {
+                    return new Ribbon(id, this.getScene(), this.pathArray, this.closeArray, this.closePath, this.offset, this.canBeRegenerated(), null, this.side);
+                };
+                return Ribbon;
+            })(_Primitive);
+            Primitives.Ribbon = Ribbon;
             var Box = (function (_super) {
                 __extends(Box, _super);
                 function Box(id, scene, size, canBeRegenerated, mesh, side) {

+ 30 - 0
Babylon/Mesh/babylon.mesh.js

@@ -1029,6 +1029,36 @@ var BABYLON;
             }, scene.database);
             return ground;
         };
+        Mesh.CreateTube = function (name, path, radius, tesselation, radiusFunction, scene, updatable, sideOrientation) {
+            if (sideOrientation === void 0) { sideOrientation = Mesh.DEFAULTSIDE; }
+            var path3D = new BABYLON.Path3D(path);
+            var tangents = path3D.getTangents();
+            var normals = path3D.getNormals();
+            var distances = path3D.getDistances();
+            var pi2 = Math.PI * 2;
+            var step = pi2 / tesselation;
+            var returnRadius = function (i, distance) { return radius; };
+            var radiusFunctionFinal = radiusFunction || returnRadius;
+            var circlePaths = [];
+            var circlePath;
+            var rad;
+            var normal;
+            var rotated;
+            var rotationMatrix;
+            for (var i = 0; i < path.length; i++) {
+                rad = radiusFunctionFinal(i, distances[i]); // current radius
+                circlePath = []; // current circle array
+                normal = normals[i]; // current normal  
+                for (var ang = 0; ang < pi2; ang += step) {
+                    rotationMatrix = BABYLON.Matrix.RotationAxis(tangents[i], ang);
+                    rotated = BABYLON.Vector3.TransformCoordinates(normal, rotationMatrix).scaleInPlace(rad).add(path[i]);
+                    circlePath.push(rotated);
+                }
+                circlePaths.push(circlePath);
+            }
+            var tube = Mesh.CreateRibbon(name, circlePaths, false, true, 0, scene, updatable, sideOrientation);
+            return tube;
+        };
         // Tools
         Mesh.MinMax = function (meshes) {
             var minVector = null;

+ 10 - 10
Babylon/Mesh/babylon.mesh.ts

@@ -1266,15 +1266,15 @@
         }
 
         public static CreateTube(name: string, path: Vector3[], radius: number, tesselation: number, radiusFunction: { (i: number, distance: number): number; }, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
-            var tube: Mesh;
-            var path3D: Path3D = new BABYLON.Path3D(path);
+            var path3D: Path3D = new Path3D(path);
             var tangents: Vector3[] = path3D.getTangents();
             var normals: Vector3[] = path3D.getNormals();
             var distances: number[] = path3D.getDistances();
             var pi2: number = Math.PI * 2;
             var step: number = pi2 / tesselation;
-            var returnRadius: { (i: number, distance: number): number; } = function(i, distance) { return radius };
-            var radiusFunction: { (i: number, distance: number): number; } = radiusFunction || returnRadius; 
+            var returnRadius: { (i: number, distance: number): number; } = (i, distance) => radius;
+            var radiusFunctionFinal: { (i: number, distance: number): number; } = radiusFunction || returnRadius;
+
             var circlePaths: Vector3[][] = [];
             var circlePath: Vector3[];
             var rad: number;
@@ -1282,17 +1282,17 @@
             var rotated: Vector3;
             var rotationMatrix: Matrix;
             for (var i: number = 0; i < path.length; i++) {
-                rad = radiusFunction(i, distances[i]);      // current radius
+                rad = radiusFunctionFinal(i, distances[i]);      // current radius
                 circlePath = [];                            // current circle array
-                normal =  normals[i]                        // current normal  
-                for( var ang: number = 0; ang < pi2; ang += step) {
-                    rotationMatrix = BABYLON.Matrix.RotationAxis(tangents[i], ang);
-                    rotated = BABYLON.Vector3.TransformCoordinates(normal, rotationMatrix).scaleInPlace(rad).add(path[i]);
+                normal = normals[i];                        // current normal  
+                for (var ang: number = 0; ang < pi2; ang += step) {
+                    rotationMatrix = Matrix.RotationAxis(tangents[i], ang);
+                    rotated = Vector3.TransformCoordinates(normal, rotationMatrix).scaleInPlace(rad).add(path[i]);
                     circlePath.push(rotated);
                 }
                 circlePaths.push(circlePath);
             }
-            tube = BABYLON.Mesh.CreateRibbon(name, circlePaths, false, true, 0, scene, updatable, sideOrientation);
+            var tube = Mesh.CreateRibbon(name, circlePaths, false, true, 0, scene, updatable, sideOrientation);
             return tube;
         }
 

+ 1 - 1
Babylon/babylon.scene.js

@@ -1150,7 +1150,7 @@ var BABYLON;
             this._lastFrameDuration = BABYLON.Tools.Now - startDate;
         };
         Scene.prototype._updateAudioParameters = function () {
-            if (this.mainSoundTrack.soundCollection.length === 0 || this.soundTracks.length === 0) {
+            if (this.mainSoundTrack.soundCollection.length === 0 && this.soundTracks.length === 0) {
                 return;
             }
             var listeningCamera;

+ 1 - 1
Babylon/babylon.scene.ts

@@ -1474,7 +1474,7 @@
         }
 
         private _updateAudioParameters() {
-            if (this.mainSoundTrack.soundCollection.length === 0 || this.soundTracks.length === 0) {
+            if (this.mainSoundTrack.soundCollection.length === 0 && this.soundTracks.length === 0) {
                 return;
             }
 

+ 147 - 7
babylon.2.1-alpha.debug.js

@@ -2406,6 +2406,90 @@ var __extends = this.__extends || function (d, b) {
         return Path2;
     })();
     BABYLON.Path2 = Path2;
+    var Path3D = (function () {
+        function Path3D(path) {
+            this.path = path;
+            this._curve = [];
+            this._distances = [];
+            this._tangents = [];
+            this._normals = [];
+            this._binormals = [];
+            this._curve = path.slice(); // copy array         
+            var l = this._curve.length;
+            // first and last tangents
+            this._tangents[0] = this._curve[1].subtract(this._curve[0]);
+            this._tangents[0].normalize();
+            this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]);
+            this._tangents[l - 1].normalize();
+            // normals and binormals at first point : arbitrary vector with _normalVector()
+            var tg0 = this._tangents[0];
+            var pp0 = this._normalVector(this._curve[0], tg0);
+            this._normals[0] = pp0;
+            this._normals[0].normalize();
+            this._binormals[0] = Vector3.Cross(tg0, this._normals[0]);
+            this._normals[0].normalize();
+            this._distances[0] = 0;
+            // normals and binormals : next points
+            var prev; // previous vector (segment)
+            var cur; // current vector (segment)
+            var curTang; // current tangent
+            var prevNorm; // previous normal
+            var prevBinor; // previous binormal
+            for (var i = 1; i < l; i++) {
+                // tangents
+                prev = this._curve[i].subtract(this._curve[i - 1]);
+                if (i < l - 1) {
+                    cur = this._curve[i + 1].subtract(this._curve[i]);
+                    this._tangents[i] = prev.add(cur);
+                    this._tangents[i].normalize();
+                }
+                this._distances[i] = this._distances[i - 1] + prev.length();
+                // normals and binormals
+                // http://www.cs.cmu.edu/afs/andrew/scs/cs/15-462/web/old/asst2camera.html
+                curTang = this._tangents[i];
+                prevNorm = this._normals[i - 1];
+                prevBinor = this._binormals[i - 1];
+                this._normals[i] = Vector3.Cross(prevBinor, curTang);
+                this._normals[i].normalize();
+                this._binormals[i] = Vector3.Cross(curTang, this._normals[i]);
+                this._binormals[i].normalize();
+            }
+        }
+        Path3D.prototype.getCurve = function () {
+            return this._curve;
+        };
+        Path3D.prototype.getTangents = function () {
+            return this._tangents;
+        };
+        Path3D.prototype.getNormals = function () {
+            return this._normals;
+        };
+        Path3D.prototype.getBinormals = function () {
+            return this._binormals;
+        };
+        Path3D.prototype.getDistances = function () {
+            return this._distances;
+        };
+        // private function normalVector(v0, vt) :
+        // returns an arbitrary point in the plane defined by the point v0 and the vector vt orthogonal to this plane
+        Path3D.prototype._normalVector = function (v0, vt) {
+            var point;
+            if (vt.x !== 1) {
+                point = new Vector3(1, 0, 0);
+            }
+            else if (vt.y !== 1) {
+                point = new Vector3(0, 1, 0);
+            }
+            else if (vt.z !== 1) {
+                point = new Vector3(0, 0, 1);
+            }
+            var normal0 = Vector3.Cross(vt, point);
+            normal0.normalize();
+            return normal0;
+        };
+        return Path3D;
+    })();
+    BABYLON.Path3D = Path3D;
 })(BABYLON || (BABYLON = {}));
 //# sourceMappingURL=babylon.math.js.mapvar BABYLON;
 (function (BABYLON) {
@@ -8676,7 +8760,7 @@ var BABYLON;
             this._lastFrameDuration = BABYLON.Tools.Now - startDate;
         };
         Scene.prototype._updateAudioParameters = function () {
-            if (this.mainSoundTrack.soundCollection.length === 0 || this.soundTracks.length === 0) {
+            if (this.mainSoundTrack.soundCollection.length === 0 && this.soundTracks.length === 0) {
                 return;
             }
             var listeningCamera;
@@ -11025,6 +11109,36 @@ var BABYLON;
             }, scene.database);
             return ground;
         };
+        Mesh.CreateTube = function (name, path, radius, tesselation, radiusFunction, scene, updatable, sideOrientation) {
+            if (sideOrientation === void 0) { sideOrientation = Mesh.DEFAULTSIDE; }
+            var path3D = new BABYLON.Path3D(path);
+            var tangents = path3D.getTangents();
+            var normals = path3D.getNormals();
+            var distances = path3D.getDistances();
+            var pi2 = Math.PI * 2;
+            var step = pi2 / tesselation;
+            var returnRadius = function (i, distance) { return radius; };
+            var radiusFunctionFinal = radiusFunction || returnRadius;
+            var circlePaths = [];
+            var circlePath;
+            var rad;
+            var normal;
+            var rotated;
+            var rotationMatrix;
+            for (var i = 0; i < path.length; i++) {
+                rad = radiusFunctionFinal(i, distances[i]); // current radius
+                circlePath = []; // current circle array
+                normal = normals[i]; // current normal  
+                for (var ang = 0; ang < pi2; ang += step) {
+                    rotationMatrix = BABYLON.Matrix.RotationAxis(tangents[i], ang);
+                    rotated = BABYLON.Vector3.TransformCoordinates(normal, rotationMatrix).scaleInPlace(rad).add(path[i]);
+                    circlePath.push(rotated);
+                }
+                circlePaths.push(circlePath);
+            }
+            var tube = Mesh.CreateRibbon(name, circlePaths, false, true, 0, scene, updatable, sideOrientation);
+            return tube;
+        };
         // Tools
         Mesh.MinMax = function (meshes) {
             var minVector = null;
@@ -11939,7 +12053,7 @@ var BABYLON;
             this._textureMatrix = BABYLON.Matrix.Identity();
         }
         CubeTexture.prototype.clone = function () {
-            var newTexture = new BABYLON.CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
+            var newTexture = new CubeTexture(this.url, this.getScene(), this._extensions, this._noMipmap);
             // Base texture
             newTexture.level = this.level;
             newTexture.wrapU = this.wrapU;
@@ -11950,7 +12064,7 @@ var BABYLON;
         };
         // Methods
         CubeTexture.prototype.delayLoad = function () {
-            if (this.delayLoadState != BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
+            if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
             }
             this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED;
@@ -18975,6 +19089,8 @@ var BABYLON;
             };
             // traverse graph per trigger
             var traverse = function (parsedAction, trigger, condition, action) {
+                if (parsedAction.detached)
+                    return;
                 var parameters = new Array();
                 var target = null;
                 var propertyPath = null;
@@ -24334,6 +24450,26 @@ var BABYLON;
                 return _Primitive;
             })(Geometry);
             Primitives._Primitive = _Primitive;
+            var Ribbon = (function (_super) {
+                __extends(Ribbon, _super);
+                function Ribbon(id, scene, pathArray, closeArray, closePath, offset, canBeRegenerated, mesh, side) {
+                    if (side === void 0) { side = BABYLON.Mesh.DEFAULTSIDE; }
+                    this.pathArray = pathArray;
+                    this.closeArray = closeArray;
+                    this.closePath = closePath;
+                    this.offset = offset;
+                    this.side = side;
+                    _super.call(this, id, scene, this._regenerateVertexData(), canBeRegenerated, mesh);
+                }
+                Ribbon.prototype._regenerateVertexData = function () {
+                    return BABYLON.VertexData.CreateRibbon(this.pathArray, this.closeArray, this.closePath, this.offset, this.side);
+                };
+                Ribbon.prototype.copy = function (id) {
+                    return new Ribbon(id, this.getScene(), this.pathArray, this.closeArray, this.closePath, this.offset, this.canBeRegenerated(), null, this.side);
+                };
+                return Ribbon;
+            })(_Primitive);
+            Primitives.Ribbon = Ribbon;
             var Box = (function (_super) {
                 __extends(Box, _super);
                 function Box(id, scene, size, canBeRegenerated, mesh, side) {
@@ -26038,15 +26174,19 @@ var BABYLON;
                 else {
                     this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
                 }
-                this._soundGain.disconnect();
-                this._soundSource.disconnect();
+                if (this._soundGain) {
+                    this._soundGain.disconnect();
+                    this._soundGain = null;
+                }
                 if (this._soundPanner) {
                     this._soundPanner.disconnect();
                     this._soundPanner = null;
                 }
+                if (this._soundSource) {
+                    this._soundSource.disconnect();
+                    this._soundSource = null;
+                }
                 this._audioBuffer = null;
-                this._soundGain = null;
-                this._soundSource = null;
                 if (this._connectedMesh) {
                     this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
                     this._connectedMesh = null;

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 11 - 11
babylon.2.1-alpha.js