Browse Source

Merge pull request #960 from jbousquie/fix.SPS.BBoxComputation

Fix.sps.b box computation
David Catuhe 9 years ago
parent
commit
1875dc7abc
2 changed files with 4 additions and 11 deletions
  1. 1 6
      src/Culling/babylon.boundingBox.ts
  2. 3 5
      src/Particles/babylon.solidParticleSystem.ts

+ 1 - 6
src/Culling/babylon.boundingBox.ts

@@ -53,11 +53,6 @@
             return this._worldMatrix;
         }
 
-        public setWorldMatrix(matrix: Matrix): BoundingBox {
-            this._worldMatrix.copyFrom(matrix);
-            return this;
-        }
-
         public _update(world: Matrix): void {
             Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld);
             Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld);
@@ -180,4 +175,4 @@
             return true;
         }
     }
-}
+}

+ 3 - 5
src/Particles/babylon.solidParticleSystem.ts

@@ -102,10 +102,8 @@ module BABYLON {
         private _w: number = 0.0;
         private _minimum: Vector3 = Tmp.Vector3[0];
         private _maximum: Vector3 = Tmp.Vector3[1];
-        private _vertexWorld: Vector3 = Tmp.Vector3[2];
-
-
 
+        
         /**
         * Creates a SPS (Solid Particle System) object.
         * @param name the SPS name, this will be the underlying mesh name
@@ -669,7 +667,7 @@ module BABYLON {
             }
             if (this._computeBoundingBox) {
                 this.mesh._boundingInfo = new BoundingInfo(this._minimum, this._maximum);
-                this.mesh._boundingInfo.boundingBox.setWorldMatrix(this.mesh._worldMatrix);
+                this.mesh._boundingInfo.update(this.mesh._worldMatrix);
             }
             this.afterUpdateParticles(start, end, update);
         }
@@ -909,4 +907,4 @@ module BABYLON {
         public afterUpdateParticles(start?: number, stop?: number, update?: boolean): void {
         }
     }
-}
+}