소스 검색

linting + fix a typo

Julien Barrois 7 년 전
부모
커밋
258b1821bb

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

@@ -253,7 +253,7 @@
          * @returns true if there is an intersection
          */
         public static Intersects(box0: BoundingBox, box1: BoundingBox): boolean {
-            return box0.intersectsMinMax(box1.minimumWorld, box1.maximumWorld)
+            return box0.intersectsMinMax(box1.minimumWorld, box1.maximumWorld);
         }
 
         /**

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

@@ -56,12 +56,12 @@ module BABYLON {
         public boundingSphere: BoundingSphere;
 
         private _isLocked = false;
-        
+
         /**
          * Constructs bounding info
          * @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 worldMatrix defines the new world matrix
          */
         constructor(minimum: Vector3, maximum: Vector3, worldMatrix?: Matrix) {
             this.boundingBox = new BoundingBox(minimum, maximum, worldMatrix);
@@ -71,7 +71,7 @@ module BABYLON {
         /**
          * 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 max defines the new maximum vector (in local space)
          * @param worldMatrix defines the new world matrix
          */
         public reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix) {

+ 5 - 12
src/Math/babylon.math.ts

@@ -1878,10 +1878,7 @@ module BABYLON {
          * @returns the current updated Vector3
          */
         public minimizeInPlace(other: Vector3): Vector3 {
-            if (other.x < this.x) this.x = other.x;
-            if (other.y < this.y) this.y = other.y;
-            if (other.z < this.z) this.z = other.z;
-            return this;
+            return this.minimizeInPlaceFromFloats(other.x, other.y, other.z);
         }
 
         /**
@@ -1890,10 +1887,7 @@ module BABYLON {
          * @returns the current updated Vector3
          */
         public maximizeInPlace(other: Vector3): Vector3 {
-            if (other.x < this.x) this.x = other.x;
-            if (other.y < this.y) this.y = other.y;
-            if (other.z < this.z) this.z = other.z;
-            return this;
+            return this.maximizeInPlaceFromFloats(other.x, other.y, other.z);
         }
 
         /**
@@ -1992,7 +1986,7 @@ module BABYLON {
          * Normalize the current Vector3 with the given input length.
          * Please note that this is an in place operation.
          * @param len the length of the vector
-         * @returns the current updated Vector3 
+         * @returns the current updated Vector3
          */
         public normalizeFromLength(len : number): Vector3 {
             if (len === 0 || len === 1.0) {
@@ -2006,7 +2000,6 @@ module BABYLON {
             return this;
         }
 
-
         /**
          * Normalize the current Vector3 to a new vector
          * @returns the new Vector3
@@ -2265,7 +2258,7 @@ module BABYLON {
          * @param result defines the Vector3 where to store the result
          */
         public static TransformCoordinatesToRef(vector: Vector3, transformation: Matrix, result: Vector3): void {
-            return Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result)
+            return Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
         }
 
         /**
@@ -2282,7 +2275,7 @@ module BABYLON {
             var rx = x * m[0] + y * m[4] + z * m[8] + m[12];
             var ry = x * m[1] + y * m[5] + z * m[9] + m[13];
             var rz = x * m[2] + y * m[6] + z * m[10] + m[14];
-            var rw = 1/(x * m[3] + y * m[7] + z * m[11] + m[15]);
+            var rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);
 
             result.x = rx * rw;
             result.y = ry * rw;

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

@@ -174,7 +174,7 @@ module BABYLON {
                             var path = pathArray[p];
                             var l = path.length;
                             minlg = (minlg < l) ? minlg : l;
-                            for (let j=0; j < minlg; ++j){
+                            for (let j = 0; j < minlg; ++j) {
                                 const pathPoint = path[j];
                                 positions[i] = pathPoint.x;
                                 positions[i + 1] = pathPoint.y;

+ 13 - 14
src/Particles/babylon.solidParticleSystem.ts

@@ -374,7 +374,7 @@ module BABYLON {
             }
             this._quaternionToRotationMatrix();
 
-            copy.pivot.multiplyToRef(copy.scaling, this._scaledPivot)
+            copy.pivot.multiplyToRef(copy.scaling, this._scaledPivot);
 
             if (copy.translateFromPivot) {
                 this._pivotBackTranslation.copyFromFloats(0.0, 0.0, 0.0);
@@ -467,7 +467,7 @@ module BABYLON {
             var shapeUV = [];
             if (uvs) {
                 for (var i = 0; i < uvs.length; i++) {
-                    shapeUV.push(uvs[i]);
+                    shapeUV.push(uvs[i]);
                 }
             }
             return shapeUV;
@@ -548,7 +548,7 @@ module BABYLON {
             if (copy.rotationQuaternion) {
                 this._quaternion.copyFrom(copy.rotationQuaternion);
             } else {
-                const rotation = copy.rotation
+                const rotation = copy.rotation;
                 this._quaternionRotationYPR(rotation.y, rotation.x, rotation.z);
             }
             this._quaternionToRotationMatrix();
@@ -664,7 +664,7 @@ module BABYLON {
                     maximum.setAll(-Number.MAX_VALUE);
                 }
                 else {      // only some particles are updated, then use the current existing BBox basis. Note : it can only increase.
-                    const boundingInfo = this.mesh._boundingInfo
+                    const boundingInfo = this.mesh._boundingInfo;
                     if (boundingInfo) {
                         minimum.copyFrom(boundingInfo.minimum);
                         maximum.copyFrom(boundingInfo.maximum);
@@ -694,13 +694,12 @@ module BABYLON {
             const indices32 = this._indices32;
             const indices = this._indices;
             const fixedNormal32 = this._fixedNormal32;
-            
 
             for (var p = start; p <= end; p++) {
                 const particle = this.particles[p];
                 const shape = particle._model._shape;
                 const shapeUV = particle._model._shapeUV;
-                
+
                 const rotationMatrix = particle._rotationMatrix;
                 const position = particle.position;
                 const rotation = particle.rotation;
@@ -750,7 +749,7 @@ module BABYLON {
                     const particleHasParent = (particle.parentId !== null);
                     if (particleHasParent) {
                         const parent = this.particles[particle.parentId!];
-                        const parentRotMatrix = parent._rotationMatrix
+                        const parentRotMatrix = parent._rotationMatrix;
                         const parentGlobalPosition = parent._globalPosition;
 
                         const rotatedY = position.x * parentRotMatrix[1] + position.y * parentRotMatrix[4] + position.z * parentRotMatrix[7];
@@ -807,7 +806,7 @@ module BABYLON {
                         if (this._computeParticleVertex) {
                             this.updateParticleVertex(particle, tmpVertex, pt);
                         }
-                        
+
                         // positions
                         const vertexX = tmpVertex.x * scaling.x - scaledPivot.x;
                         const vertexY = tmpVertex.y * scaling.y - scaledPivot.y;
@@ -821,13 +820,13 @@ module BABYLON {
                         rotatedY += pivotBackTranslation.y;
                         rotatedZ += pivotBackTranslation.z;
 
-                        positions32[idx] = globalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ;
-                        positions32[idx + 1] = globalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ;
-                        positions32[idx + 2] = globalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;
+                        const px = positions32[idx] = globalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ;
+                        const py = positions32[idx + 1] = globalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ;
+                        const pz = positions32[idx + 2] = globalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ;
 
                         if (this._computeBoundingBox) {
-                            minimum.minimizeInPlaceFromFloats(positions32[idx], positions32[idx+1], positions32[idx+1]);
-                            maximum.maximizeInPlaceFromFloats(positions32[idx], positions32[idx+1], positions32[idx+1]);
+                            minimum.minimizeInPlaceFromFloats(px, py, pz);
+                            maximum.maximizeInPlaceFromFloats(px, py, pz);
                         }
 
                         // normals : if the particles can't be morphed then just rotate the normals, what is much more faster than ComputeNormals()
@@ -989,7 +988,7 @@ module BABYLON {
             return this;
         }
 
-        private _quaternionRotationYPR(yaw:number, pitch:number, roll:number): void {
+        private _quaternionRotationYPR(yaw: number, pitch: number, roll: number): void {
             const halfroll = roll * 0.5;
             const halfpitch = pitch * 0.5;
             const halfyaw = yaw * 0.5;