Bladeren bron

revert unwanted changes

Julien Barrois 6 jaren geleden
bovenliggende
commit
aa5b9706f0
3 gewijzigde bestanden met toevoegingen van 7 en 22 verwijderingen
  1. 2 3
      src/Culling/babylon.boundingBox.ts
  2. 2 2
      src/Culling/babylon.boundingInfo.ts
  3. 3 17
      src/Culling/babylon.boundingSphere.ts

+ 2 - 3
src/Culling/babylon.boundingBox.ts

@@ -69,7 +69,7 @@ module BABYLON {
         // Methods
 
         /**
-         * Recreates the entire bounding box from scratch, using the already provided world Matrix if any.
+         * Recreates the entire bounding box from scratch
          * @param min defines the new minimum vector (in local space)
          * @param max defines the new maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
@@ -112,14 +112,13 @@ module BABYLON {
             const min = this.center.subtractToRef(newRadius, tmpVectors[1]);
             const max = this.center.addToRef(newRadius, tmpVectors[2]);
 
-            this.reConstruct(min, max, this._worldMatrix);
+            this.reConstruct(min, max);
 
             return this;
         }
 
         /**
          * Gets the world matrix of the bounding box.
-         * must not be modified
          * @returns a matrix
          */
         public getWorldMatrix(): Matrix {

+ 2 - 2
src/Culling/babylon.boundingInfo.ts

@@ -71,10 +71,10 @@ module BABYLON {
         }
 
         /**
-         * Recreates the entire bounding info from scratch, producing same values as if the constructor was called.
+         * Recreates the entire bounding info from scratch
          * @param min defines the new minimum vector (in local space)
          * @param max defines the new maximum vector (in local space)
-         * @param worldMatrix defines the new world matrix.
+         * @param worldMatrix defines the new world matrix
          */
         public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
             this.boundingBox.reConstruct(min, max, worldMatrix);

+ 3 - 17
src/Culling/babylon.boundingSphere.ts

@@ -28,8 +28,6 @@ module BABYLON {
          */
         public maximum = Vector3.Zero();
 
-        private _worldMatrix: Matrix;
-
         private static readonly TmpVector3 = Tools.BuildArray(3, Vector3.Zero);
         // This matrix is used as a value to reset the bounding box.
         private static readonly _identityMatrix = Matrix.Identity();
@@ -45,7 +43,7 @@ module BABYLON {
         }
 
         /**
-         * Recreates the entire bounding sphere from scratch, producing same values as if the constructor was called.
+         * Recreates the entire bounding sphere from scratch
          * @param min defines the new minimum vector (in local space)
          * @param max defines the new maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
@@ -74,7 +72,7 @@ module BABYLON {
             const min = this.center.subtractToRef(tempRadiusVector, tmpVectors[1]);
             const max = this.center.addToRef(tempRadiusVector, tmpVectors[2]);
 
-            this.reConstruct(min, max, this._worldMatrix);
+            this.reConstruct(min, max);
 
             return this;
         }
@@ -82,9 +80,7 @@ module BABYLON {
         // Methods
         /** @hidden */
         public _update(worldMatrix: Matrix): void {
-            this._worldMatrix = worldMatrix;
-
-            if (this._worldMatrix !== BoundingSphere._identityMatrix) {
+            if (worldMatrix !== BoundingSphere._identityMatrix) {
                 Vector3.TransformCoordinatesToRef(this.center, worldMatrix, this.centerWorld);
                 const tempVector = BoundingSphere.TmpVector3[0];
                 Vector3.TransformNormalFromFloatsToRef(1.0, 1.0, 1.0, worldMatrix, tempVector);
@@ -142,15 +138,5 @@ module BABYLON {
 
             return true;
         }
-
-        /**
-         * Gets the world matrix of the bounding box.
-         * must not be modified
-         * @returns a matrix
-         */
-        public getWorldMatrix(): Matrix {
-            return this._worldMatrix;
-        }
-
     }
 }