Browse Source

revert some changes and only integrate the intersection threshold in the picking

Julien Barrois 6 năm trước cách đây
mục cha
commit
517eb2502d

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

@@ -51,12 +51,6 @@ module BABYLON {
          */
         public maximum: Vector3 = Vector3.Zero();
 
-        /**
-         * an optional extra extent that will be added in all diretions to the world BoundingBox.
-         * Note that vectorsWorld value is not impacted by this, only minimumWorld, maximumWorld and extendSizeWorld.
-         */
-        public extraWorldExtent: number;
-
         private _worldMatrix: Matrix;
         private static TmpVector3 = Tools.BuildArray(3, Vector3.Zero);
 
@@ -70,10 +64,9 @@ module BABYLON {
          * @param min defines the minimum vector (in local space)
          * @param max defines the maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
-         * @param extraWorldExtent an extra extent that will be added in all diretions to the world BoundingBox
          */
-        constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
-            this.reConstruct(min, max, worldMatrix, extraWorldExtent);
+        constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
+            this.reConstruct(min, max, worldMatrix);
         }
 
         // Methods
@@ -84,7 +77,7 @@ module BABYLON {
          * @param max defines the new maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
          */
-        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
+        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
             const minX = min.x, minY = min.y, minZ = min.z, maxX = max.x, maxY = max.y, maxZ = max.z;
             const vectors = this.vectors;
 
@@ -103,7 +96,7 @@ module BABYLON {
             max.addToRef(min, this.center).scaleInPlace(0.5);
             max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
 
-            this._update(worldMatrix || _identityMatrix, extraWorldExtent || 0);
+            this._update(worldMatrix || _identityMatrix);
         }
 
         /**
@@ -122,7 +115,7 @@ 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.extraWorldExtent);
+            this.reConstruct(min, max, this._worldMatrix);
 
             return this;
         }
@@ -147,7 +140,7 @@ module BABYLON {
         }
 
         /** @hidden */
-        public _update(world: Matrix, extraWorldExtent: number): void {
+        public _update(world: Matrix): void {
             const minWorld = this.minimumWorld;
             const maxWorld = this.maximumWorld;
             const directions = this.directions;
@@ -173,11 +166,6 @@ module BABYLON {
                 }
             }
 
-            if (extraWorldExtent) {
-                minWorld.addInPlaceFromFloats(-extraWorldExtent, -extraWorldExtent, -extraWorldExtent);
-                maxWorld.addInPlaceFromFloats(extraWorldExtent, extraWorldExtent, extraWorldExtent);
-            }
-
             maxWorld.subtractToRef(minWorld, this.extendSizeWorld).scaleInPlace(0.5);
             maxWorld.addToRef(minWorld, this.centerWorld).scaleInPlace(0.5);
 
@@ -185,7 +173,6 @@ module BABYLON {
             Vector3.FromArrayToRef(world.m, 4, directions[1]);
             Vector3.FromArrayToRef(world.m, 8, directions[2]);
 
-            this.extraWorldExtent = extraWorldExtent;
             this._worldMatrix = world;
         }
 

+ 10 - 21
src/Culling/babylon.boundingInfo.ts

@@ -62,11 +62,10 @@ module BABYLON {
          * @param minimum min vector of the bounding box/sphere
          * @param maximum max vector of the bounding box/sphere
          * @param worldMatrix defines the new world matrix
-         * @param extraWorldExtent an extra extent that will be added in all diretions to the world BoundingInfo only
          */
-        constructor(minimum: Vector3, maximum: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
-            this.boundingBox = new BoundingBox(minimum, maximum, worldMatrix, extraWorldExtent);
-            this.boundingSphere = new BoundingSphere(minimum, maximum, worldMatrix, extraWorldExtent);
+        constructor(minimum: Vector3, maximum: Vector3, worldMatrix?: Matrix) {
+            this.boundingBox = new BoundingBox(minimum, maximum, worldMatrix);
+            this.boundingSphere = new BoundingSphere(minimum, maximum, worldMatrix);
         }
 
         /**
@@ -74,11 +73,10 @@ module BABYLON {
          * @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 extraWorldExtent an extra extent that will be added in all diretions to the world BoundingInfo only
          */
-        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
-            this.boundingBox.reConstruct(min, max, worldMatrix, extraWorldExtent);
-            this.boundingSphere.reConstruct(min, max, worldMatrix, extraWorldExtent);
+        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
+            this.boundingBox.reConstruct(min, max, worldMatrix);
+            this.boundingSphere.reConstruct(min, max, worldMatrix);
         }
 
         /**
@@ -96,13 +94,6 @@ module BABYLON {
         }
 
         /**
-         * extra extent added to the world BoundingBox and BoundingSphere
-         */
-        public get extraWorldExtent(): number | undefined {
-            return this.boundingBox.extraWorldExtent;
-        }
-
-        /**
          * If the info is locked and won't be updated to avoid perf overhead
          */
         public get isLocked(): boolean {
@@ -122,9 +113,8 @@ module BABYLON {
             if (this._isLocked) {
                 return;
             }
-            const extraWorldExtent = this.boundingBox.extraWorldExtent;
-            this.boundingBox._update(world, extraWorldExtent);
-            this.boundingSphere._update(world, extraWorldExtent);
+            this.boundingBox._update(world);
+            this.boundingSphere._update(world);
         }
 
         /**
@@ -138,9 +128,8 @@ module BABYLON {
             const minimum = Tmp.Vector3[0].copyFrom(center).subtractInPlace(extend);
             const maximum = Tmp.Vector3[1].copyFrom(center).addInPlace(extend);
 
-            const extraWorldExtent = this.boundingBox.extraWorldExtent;
-            this.boundingBox.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix(), extraWorldExtent);
-            this.boundingSphere.reConstruct(minimum, maximum, this.boundingSphere.getWorldMatrix(), extraWorldExtent);
+            this.boundingBox.reConstruct(minimum, maximum, this.boundingBox.getWorldMatrix());
+            this.boundingSphere.reConstruct(minimum, maximum, this.boundingSphere.getWorldMatrix());
 
             return this;
         }

+ 6 - 18
src/Culling/babylon.boundingSphere.ts

@@ -31,11 +31,6 @@ module BABYLON {
          */
         public maximum = Vector3.Zero();
 
-        /**
-         * an optional extra extent that will be added in all diretions to the world BoundingBox.
-         * Note that vectorsWorld value is not impacted by this, only minimumWorld, maximumWorld and extendSizeWorld.
-         */
-        private _extraWorldExtent: number | undefined;
         private _worldMatrix: Matrix;
 
         private static TmpVector3 = Tools.BuildArray(3, Vector3.Zero);
@@ -45,10 +40,9 @@ module BABYLON {
          * @param min defines the minimum vector (in local space)
          * @param max defines the maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
-         * @param extraWorldExtent an extra extent that will be added in all diretions to the world BoundingSphere
          */
-        constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
-            this.reConstruct(min, max, worldMatrix, extraWorldExtent);
+        constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
+            this.reConstruct(min, max, worldMatrix);
         }
 
         /**
@@ -56,9 +50,8 @@ module BABYLON {
          * @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 extraWorldExtent an extra extent that will be added in all diretions to the world BoundingSphere
          */
-        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix, extraWorldExtent?: number) {
+        public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix) {
             this.minimum.copyFrom(min);
             this.maximum.copyFrom(max);
 
@@ -67,7 +60,7 @@ module BABYLON {
             max.addToRef(min, this.center).scaleInPlace(0.5);
             this.radius = distance * 0.5;
 
-            this._update(worldMatrix || _identityMatrix, extraWorldExtent);
+            this._update(worldMatrix || _identityMatrix);
         }
 
         /**
@@ -82,16 +75,15 @@ 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._extraWorldExtent);
+            this.reConstruct(min, max, this._worldMatrix);
 
             return this;
         }
 
         // Methods
         /** @hidden */
-        public _update(worldMatrix: Matrix, extraWorldExtent?: number): void {
+        public _update(worldMatrix: Matrix): void {
             this._worldMatrix = worldMatrix;
-            this._extraWorldExtent = extraWorldExtent;
 
             if (this._worldMatrix !== _identityMatrix) {
                 Vector3.TransformCoordinatesToRef(this.center, worldMatrix, this.centerWorld);
@@ -103,10 +95,6 @@ module BABYLON {
                 this.centerWorld.copyFrom(this.center);
                 this.radiusWorld = this.radius;
             }
-
-            if (extraWorldExtent) {
-                this.radiusWorld += extraWorldExtent;
-            }
         }
 
         /**

+ 34 - 37
src/Culling/babylon.ray.ts

@@ -3,11 +3,13 @@ module BABYLON {
      * Class representing a ray with position and direction
      */
     export class Ray {
-        private _edge1: Vector3;
-        private _edge2: Vector3;
-        private _pvec: Vector3;
-        private _tvec: Vector3;
-        private _qvec: Vector3;
+        private static _edge1 = Vector3.Zero();
+        private static _edge2 = Vector3.Zero();
+        private static _pvec = Vector3.Zero();
+        private static _tvec = Vector3.Zero();
+        private static _qvec = Vector3.Zero();
+        private static _min = Vector3.Zero();
+        private static _max = Vector3.Zero();
 
         private _tmpRay: Ray;
 
@@ -33,7 +35,9 @@ module BABYLON {
          * @param maximum bound of the box
          * @returns if the box was hit
          */
-        public intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean {
+        public intersectsBoxMinMax(minimum: Vector3, maximum: Vector3, intersectionTreshold: number = 0): boolean {
+            const newMinimum = Ray._min.copyFromFloats(minimum.x - intersectionTreshold, minimum.y - intersectionTreshold, minimum.z - intersectionTreshold);
+            const newMaximum = Ray._max.copyFromFloats(maximum.x + intersectionTreshold, maximum.y + intersectionTreshold, maximum.z + intersectionTreshold);
             var d = 0.0;
             var maxValue = Number.MAX_VALUE;
             var inv: number;
@@ -41,14 +45,14 @@ module BABYLON {
             var max: number;
             var temp: number;
             if (Math.abs(this.direction.x) < 0.0000001) {
-                if (this.origin.x < minimum.x || this.origin.x > maximum.x) {
+                if (this.origin.x < newMinimum.x || this.origin.x > newMaximum.x) {
                     return false;
                 }
             }
             else {
                 inv = 1.0 / this.direction.x;
-                min = (minimum.x - this.origin.x) * inv;
-                max = (maximum.x - this.origin.x) * inv;
+                min = (newMinimum.x - this.origin.x) * inv;
+                max = (newMaximum.x - this.origin.x) * inv;
                 if (max === -Infinity) {
                     max = Infinity;
                 }
@@ -68,14 +72,14 @@ module BABYLON {
             }
 
             if (Math.abs(this.direction.y) < 0.0000001) {
-                if (this.origin.y < minimum.y || this.origin.y > maximum.y) {
+                if (this.origin.y < newMinimum.y || this.origin.y > newMaximum.y) {
                     return false;
                 }
             }
             else {
                 inv = 1.0 / this.direction.y;
-                min = (minimum.y - this.origin.y) * inv;
-                max = (maximum.y - this.origin.y) * inv;
+                min = (newMinimum.y - this.origin.y) * inv;
+                max = (newMaximum.y - this.origin.y) * inv;
 
                 if (max === -Infinity) {
                     max = Infinity;
@@ -96,14 +100,14 @@ module BABYLON {
             }
 
             if (Math.abs(this.direction.z) < 0.0000001) {
-                if (this.origin.z < minimum.z || this.origin.z > maximum.z) {
+                if (this.origin.z < newMinimum.z || this.origin.z > newMaximum.z) {
                     return false;
                 }
             }
             else {
                 inv = 1.0 / this.direction.z;
-                min = (minimum.z - this.origin.z) * inv;
-                max = (maximum.z - this.origin.z) * inv;
+                min = (newMinimum.z - this.origin.z) * inv;
+                max = (newMaximum.z - this.origin.z) * inv;
 
                 if (max === -Infinity) {
                     max = Infinity;
@@ -130,8 +134,8 @@ module BABYLON {
          * @param box the bounding box to check
          * @returns if the box was hit
          */
-        public intersectsBox(box: BoundingBox): boolean {
-            return this.intersectsBoxMinMax(box.minimum, box.maximum);
+        public intersectsBox(box: BoundingBox, intersectionTreshold: number = 0): boolean {
+            return this.intersectsBoxMinMax(box.minimum, box.maximum, intersectionTreshold);
         }
 
         /**
@@ -139,12 +143,13 @@ module BABYLON {
          * @param sphere the bounding sphere to check
          * @returns true if it hits the sphere
          */
-        public intersectsSphere(sphere: BoundingSphere): boolean {
+        public intersectsSphere(sphere: BoundingSphere, intersectionTreshold: number = 0): boolean {
             var x = sphere.center.x - this.origin.x;
             var y = sphere.center.y - this.origin.y;
             var z = sphere.center.z - this.origin.z;
             var pyth = (x * x) + (y * y) + (z * z);
-            var rr = sphere.radius * sphere.radius;
+            const radius = sphere.radius + intersectionTreshold;
+            var rr = radius * radius;
 
             if (pyth <= rr) {
                 return true;
@@ -168,18 +173,10 @@ module BABYLON {
          * @returns intersection information if hit
          */
         public intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): Nullable<IntersectionInfo> {
-            if (!this._edge1) {
-                this._edge1 = Vector3.Zero();
-                this._edge2 = Vector3.Zero();
-                this._pvec = Vector3.Zero();
-                this._tvec = Vector3.Zero();
-                this._qvec = Vector3.Zero();
-            }
-
-            vertex1.subtractToRef(vertex0, this._edge1);
-            vertex2.subtractToRef(vertex0, this._edge2);
-            Vector3.CrossToRef(this.direction, this._edge2, this._pvec);
-            var det = Vector3.Dot(this._edge1, this._pvec);
+            vertex1.subtractToRef(vertex0, Ray._edge1);
+            vertex2.subtractToRef(vertex0, Ray._edge2);
+            Vector3.CrossToRef(this.direction, Ray._edge2, Ray._pvec);
+            var det = Vector3.Dot(Ray._edge1, Ray._pvec);
 
             if (det === 0) {
                 return null;
@@ -187,24 +184,24 @@ module BABYLON {
 
             var invdet = 1 / det;
 
-            this.origin.subtractToRef(vertex0, this._tvec);
+            this.origin.subtractToRef(vertex0, Ray._tvec);
 
-            var bu = Vector3.Dot(this._tvec, this._pvec) * invdet;
+            var bu = Vector3.Dot(Ray._tvec, Ray._pvec) * invdet;
 
             if (bu < 0 || bu > 1.0) {
                 return null;
             }
 
-            Vector3.CrossToRef(this._tvec, this._edge1, this._qvec);
+            Vector3.CrossToRef(Ray._tvec, Ray._edge1, Ray._qvec);
 
-            var bv = Vector3.Dot(this.direction, this._qvec) * invdet;
+            var bv = Vector3.Dot(this.direction, Ray._qvec) * invdet;
 
             if (bv < 0 || bu + bv > 1.0) {
                 return null;
             }
 
             //check if the distance is longer than the predefined length.
-            var distance = Vector3.Dot(this._edge2, this._qvec) * invdet;
+            var distance = Vector3.Dot(Ray._edge2, Ray._qvec) * invdet;
             if (distance > this.length) {
                 return null;
             }
@@ -353,7 +350,7 @@ module BABYLON {
                 if (-d < 0.0) {
                     sN = 0.0;
                 } else if (-d > a) {
-                    sN = sD;
+                    sN = sD;
                        }
                 else {
                     sN = -d;

+ 10 - 11
src/Mesh/babylon.abstractMesh.ts

@@ -266,13 +266,13 @@ module BABYLON {
 
             // remove from material mesh map id needed
             if (this._material && this._material.meshMap) {
-                this._material.meshMap[this.uniqueId] = undefined;
+                this._material.meshMap[this.uniqueId] = undefined;
             }
 
             this._material = value;
 
             if (value && value.meshMap) {
-                value.meshMap[this.uniqueId] = this;
+                value.meshMap[this.uniqueId] = this;
             }
 
             if (this.onMaterialChangedObservable.hasObservers) {
@@ -1298,8 +1298,9 @@ module BABYLON {
          */
         public intersects(ray: Ray, fastCheck?: boolean): PickingInfo {
             var pickingInfo = new PickingInfo();
-
-            if (!this.subMeshes || !this._boundingInfo || !ray.intersectsSphere(this._boundingInfo.boundingSphere) || !ray.intersectsBox(this._boundingInfo.boundingBox)) {
+            const intersectionTreshold = this.getClassName() === "LinesMesh" ? (<LinesMesh>(this as any)).intersectionThreshold : 0;
+            const boundingInfo = this._boundingInfo;
+            if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionTreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionTreshold)) {
                 return pickingInfo;
             }
 
@@ -1335,13 +1336,11 @@ module BABYLON {
 
             if (intersectInfo) {
                 // Get picked point
-                var world = this.getWorldMatrix();
-                var worldOrigin = Vector3.TransformCoordinates(ray.origin, world);
-                var direction = ray.direction.clone();
-                direction = direction.scale(intersectInfo.distance);
-                var worldDirection = Vector3.TransformNormal(direction, world);
-
-                var pickedPoint = worldOrigin.add(worldDirection);
+                const world = this.getWorldMatrix();
+                const worldOrigin = Vector3.TransformCoordinates(ray.origin, world);
+                const direction = ray.direction.scaleToRef(intersectInfo.distance, Tmp.Vector3[0]);
+                const worldDirection = Vector3.TransformNormal(direction, world);
+                const pickedPoint = worldDirection.addInPlace(worldOrigin);
 
                 // Return result
                 pickingInfo.hit = true;

+ 5 - 10
src/Mesh/babylon.geometry.ts

@@ -33,7 +33,6 @@ module BABYLON {
         private _isDisposed = false;
         private _extend: { minimum: Vector3, maximum: Vector3 };
         private _boundingBias: Vector2;
-        public _boundingWorldExtraExtent: number = 0;
         /** @hidden */
         public _delayInfo: Array<string>;
         private _indexBuffer: Nullable<WebGLBuffer>;
@@ -118,10 +117,6 @@ module BABYLON {
 
             // applyToMesh
             if (mesh) {
-                if (mesh.getClassName() === "LinesMesh") {
-                    this._boundingWorldExtraExtent = (<LinesMesh>mesh).intersectionThreshold;
-                }
-
                 this.applyToMesh(mesh);
                 mesh.computeWorldMatrix(true);
             }
@@ -253,7 +248,7 @@ module BABYLON {
 
                 for (var index = 0; index < numOfMeshes; index++) {
                     var mesh = meshes[index];
-                    mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum, undefined, this._boundingWorldExtraExtent);
+                    mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum);
                     mesh._createGlobalSubMesh(false);
                     mesh.computeWorldMatrix(true);
                 }
@@ -320,10 +315,10 @@ module BABYLON {
                 var meshes = this._meshes;
                 for (const mesh of meshes) {
                     if (mesh._boundingInfo) {
-                        mesh._boundingInfo.reConstruct(this._extend.minimum, this._extend.maximum, undefined, this._boundingWorldExtraExtent);
+                        mesh._boundingInfo.reConstruct(this._extend.minimum, this._extend.maximum);
                     }
                     else {
-                        mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum, undefined, this._boundingWorldExtraExtent);
+                        mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum);
                     }
 
                     const subMeshes = mesh.subMeshes;
@@ -687,7 +682,7 @@ module BABYLON {
                     if (!this._extend) {
                         this._updateExtend();
                     }
-                    mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum, undefined, this._boundingWorldExtraExtent);
+                    mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum);
 
                     mesh._createGlobalSubMesh(false);
 
@@ -937,7 +932,7 @@ module BABYLON {
             }
 
             // Bounding info
-            geometry._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum, undefined, this._boundingWorldExtraExtent);
+            geometry._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum);
 
             return geometry;
         }

+ 2 - 2
src/Mesh/babylon.instancedMesh.ts

@@ -221,10 +221,10 @@ module BABYLON {
             var meshBB = this._sourceMesh.getBoundingInfo();
 
             if (this._boundingInfo) {
-                this._boundingInfo.reConstruct(meshBB.minimum, meshBB.maximum, undefined, meshBB.extraWorldExtent);
+                this._boundingInfo.reConstruct(meshBB.minimum, meshBB.maximum);
             }
             else {
-                this._boundingInfo = new BoundingInfo(meshBB.minimum, meshBB.maximum, undefined, meshBB.extraWorldExtent);
+                this._boundingInfo = new BoundingInfo(meshBB.minimum, meshBB.maximum);
             }
 
             this._updateBoundingInfo();

+ 0 - 4
src/Mesh/babylon.linesMesh.ts

@@ -31,11 +31,7 @@ module BABYLON {
             if (this._intersectionThreshold === value) {
                 return;
             }
-
             this._intersectionThreshold = value;
-            if (this.geometry) {
-                this.geometry._boundingWorldExtraExtent = value;
-            }
         }
 
         private _intersectionThreshold: number;

+ 6 - 6
src/Mesh/babylon.mesh.ts

@@ -871,9 +871,10 @@ module BABYLON {
         /** @hidden */
         public _registerInstanceForRenderId(instance: InstancedMesh, renderId: number): Mesh {
             if (!this._instanceDataStorage.visibleInstances) {
-                this._instanceDataStorage.visibleInstances = {};
-                this._instanceDataStorage.visibleInstances.defaultRenderId = renderId;
-                this._instanceDataStorage.visibleInstances.selfDefaultRenderId = this._renderId;
+                this._instanceDataStorage.visibleInstances = {
+                    defaultRenderId: renderId,
+                    selfDefaultRenderId: this._renderId
+                }
             }
 
             if (!this._instanceDataStorage.visibleInstances[renderId]) {
@@ -899,16 +900,15 @@ module BABYLON {
                 return this;
             }
 
-            let extraWorldExtent = this.geometry ? this.geometry._boundingWorldExtraExtent : undefined;
             var data = this._getPositionData(applySkeleton);
             if (data) {
                 const bias = this.geometry ? this.geometry.boundingBias : null;
                 var extend = Tools.ExtractMinAndMax(data, 0, this.getTotalVertices(), bias);
                 if (this._boundingInfo) {
-                    this._boundingInfo.reConstruct(extend.minimum, extend.maximum, undefined, extraWorldExtent);
+                    this._boundingInfo.reConstruct(extend.minimum, extend.maximum);
                 }
                 else {
-                    this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum, undefined, extraWorldExtent);
+                    this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum);
                 }
             }
 

+ 1 - 1
src/Mesh/babylon.subMesh.ts

@@ -434,7 +434,7 @@ module BABYLON {
                     return result;
                 }
 
-                result._boundingInfo = new BoundingInfo(boundingInfo.minimum, boundingInfo.maximum, undefined, boundingInfo.extraWorldExtent);
+                result._boundingInfo = new BoundingInfo(boundingInfo.minimum, boundingInfo.maximum);
             }
 
             return result;

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

@@ -125,7 +125,7 @@ module BABYLON {
             this._sps = sps;
             if (modelBoundingInfo) {
                 this._modelBoundingInfo = modelBoundingInfo;
-                this._boundingInfo = new BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum, undefined, modelBoundingInfo.extraWorldExtent);
+                this._boundingInfo = new BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum);
             }
         }
 

+ 2 - 2
src/Particles/babylon.solidParticleSystem.ts

@@ -891,7 +891,7 @@ module BABYLON {
                             tempMax.maximizeInPlaceFromFloats(x, y, z);
                         }
 
-                        bBox.reConstruct(tempMin, tempMax, mesh._worldMatrix, bInfo.extraWorldExtent);
+                        bBox.reConstruct(tempMin, tempMax, mesh._worldMatrix);
                     }
 
                     // place and scale the particle bouding sphere in the SPS local system, then update it
@@ -902,7 +902,7 @@ module BABYLON {
                     const halfDiag = maxBbox.subtractToRef(minBbox, tempVectors[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor);
                     const bSphereMinBbox = bSphereCenter.subtractToRef(halfDiag, tempVectors[1]);
                     const bSphereMaxBbox = bSphereCenter.addToRef(halfDiag, tempVectors[2]);
-                    bSphere.reConstruct(bSphereMinBbox, bSphereMaxBbox, mesh._worldMatrix, bInfo.extraWorldExtent);
+                    bSphere.reConstruct(bSphereMinBbox, bSphereMaxBbox, mesh._worldMatrix);
                 }
 
                 // increment indexes for the next particle