Explorar o código

typo + styling

Julien Barrois %!s(int64=6) %!d(string=hai) anos
pai
achega
6f13534827

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

@@ -52,10 +52,11 @@ module BABYLON {
         public maximum: Vector3 = Vector3.Zero();
 
         /**
-         * an optional extra extent that will be added in all diretionsto the world BoundingBox.
+         * 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);
 
@@ -69,7 +70,7 @@ 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 diretionsto the world BoundingBox
+         * @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);
@@ -168,7 +169,7 @@ module BABYLON {
                 minWorld.copyFrom(this.minimum);
                 maxWorld.copyFrom(this.maximum);
                 for (let index = 0; index < 8; ++index) {
-                    vectorsWorld[index].copyFrom(vectors[index]);
+                    vectorsWorld[index].copyFrom(vectors[index]);
                 }
             }
 
@@ -177,13 +178,13 @@ module BABYLON {
                 maxWorld.addInPlaceFromFloats(extraWorldExtent, extraWorldExtent, extraWorldExtent);
             }
 
+            maxWorld.subtractToRef(minWorld, this.extendSizeWorld).scaleInPlace(0.5);
+            maxWorld.addToRef(minWorld, this.centerWorld).scaleInPlace(0.5);
+
             Vector3.FromArrayToRef(world.m, 0, directions[0]);
             Vector3.FromArrayToRef(world.m, 4, directions[1]);
             Vector3.FromArrayToRef(world.m, 8, directions[2]);
 
-            maxWorld.subtractToRef(minWorld, this.extendSizeWorld).scaleInPlace(0.5);
-            maxWorld.addToRef(minWorld, this.centerWorld).scaleInPlace(0.5);
-
             this.extraWorldExtent = extraWorldExtent;
             this._worldMatrix = world;
         }

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

@@ -62,7 +62,7 @@ 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 diretionsto the world BoundingInfo only
+         * @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);
@@ -74,7 +74,7 @@ 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 diretionsto the world BoundingInfo only
+         * @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);

+ 4 - 4
src/Culling/babylon.boundingSphere.ts

@@ -32,7 +32,7 @@ module BABYLON {
         public maximum = Vector3.Zero();
 
         /**
-         * an optional extra extent that will be added in all diretionsto the world BoundingBox.
+         * 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;
@@ -45,7 +45,7 @@ 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 diretionsto the world BoundingSphere
+         * @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);
@@ -56,7 +56,7 @@ 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 diretionsto the world BoundingSphere
+         * @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) {
             this.minimum.copyFrom(min);
@@ -105,7 +105,7 @@ module BABYLON {
             }
 
             if (extraWorldExtent) {
-                this.radiusWorld += extraWorldExtent;
+                this.radiusWorld += extraWorldExtent;
             }
         }