David Catuhe 7 vuotta sitten
vanhempi
commit
67b14f043f

+ 10 - 28
src/Animations/babylon.animationGroup.ts

@@ -366,33 +366,9 @@ module BABYLON {
         // Statics
         /**
          * Returns a new AnimationGroup object parsed from the source provided.
-         * @param {Object} parsedAnimationGroup - is the source.
-         * @param {Scene} scene - is the scene that will receive the animationGroup
-         * Example of an expected source
-         * {
-                "name": "Run",
-                "from": 0.0,
-                "to": 1.0,
-                "targetedAnimations": [{
-                    "animation": {
-                        "name": "rotationQuaternion animation",
-                        "property": "rotationQuaternion",
-                        "dataType": 2,
-                        "enableBlending": false,
-                        "blendingSpeed": 0.01,
-                        "loopBehavior": 1,
-                        "framePerSecond": 30,
-                        "keys": [{
-                            "frame": 0,
-                            "values": [-0.7071, -0.002, 0.0022, 0.7071]
-                        }, {
-                            "frame": 1,
-                            "values": [-0.7082, -0.0485, 0.0026, 0.7043]
-                        }]
-                    },
-                    "targetId": "d64f9288-d06a-4a70-872f-edbb5a3779c6"
-                }]
-            }
+         * @param parsedAnimationGroup defines the source
+         * @param scene defines the scene that will receive the animationGroup
+         * @returns a new AnimationGroup
          */
         public static Parse(parsedAnimationGroup: any, scene: Scene): AnimationGroup {
             var animationGroup = new BABYLON.AnimationGroup(parsedAnimationGroup.name, scene);
@@ -412,12 +388,18 @@ module BABYLON {
             return animationGroup;
         }
 
+        /**
+         * Returns the string "AnimationGroup"
+         * @returns "AnimationGroup"
+         */
         public getClassName(): string {
             return "AnimationGroup";
         }
 
         /**
-         * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
+         * Creates a detailled string about the object
+         * @param fullDetails defines if the output string will support multiple levels of logging within scene loading
+         * @returns a string representing the object
          */
         public toString(fullDetails?: boolean): string {
             var ret = "Name: " + this.name;

+ 3 - 1
src/Mesh/babylon.meshBuilder.ts

@@ -704,7 +704,9 @@
                 var product = Math.acos(Vector3.Dot(options.sourcePlane.normal, Axis.Z));
                 var vectorProduct = Vector3.Cross(Axis.Z, options.sourcePlane.normal);
 
-                plane.rotate(vectorProduct, product);
+                if (vectorProduct.lengthSquared() > Epsilon) {
+                    plane.rotate(vectorProduct, product);
+                }
             }
 
             return plane;

+ 1 - 1
src/Particles/babylon.baseParticleSystem.ts

@@ -537,7 +537,7 @@ module BABYLON {
         }
 
         /** @hidden */
-        protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: RawTexture): BaseParticleSystem {
+        protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: Nullable<RawTexture>): BaseParticleSystem {
             if (!gradients) {
                 return this;
             }

+ 6 - 1
src/Particles/babylon.particleSystem.ts

@@ -88,7 +88,7 @@
         public _currentStartSize2 = 0;
 
         private readonly _rawTextureWidth = 256;
-        private _rampGradientsTexture: RawTexture;
+        private _rampGradientsTexture: Nullable<RawTexture>;
         private _useRampGradients = false;
 
         /** Gets or sets a boolean indicating that ramp gradients must be used
@@ -1740,6 +1740,11 @@
                 this.noiseTexture = null;
             }
 
+            if (this._rampGradientsTexture) {
+                this._rampGradientsTexture.dispose();
+                this._rampGradientsTexture = null;
+            }
+
             this._removeFromRoot();
 
             if (this._disposeEmitterOnDispose && !(<AbstractMesh>this.emitter).isDisposed) {