Browse Source

var's replaced with let&const

Rawr 5 years ago
parent
commit
7a968c3f4d
1 changed files with 24 additions and 24 deletions
  1. 24 24
      src/geometries/BoxGeometry.js

+ 24 - 24
src/geometries/BoxGeometry.js

@@ -53,7 +53,7 @@ class BoxBufferGeometry extends BufferGeometry {
 			depthSegments: depthSegments
 		};
 
-		var scope = this;
+		const scope = this;
 
 		width = width || 1;
 		height = height || 1;
@@ -67,15 +67,15 @@ class BoxBufferGeometry extends BufferGeometry {
 
 		// buffers
 
-		var indices = [];
-		var vertices = [];
-		var normals = [];
-		var uvs = [];
+		const indices = [];
+		const vertices = [];
+		const normals = [];
+		const uvs = [];
 
 		// helper variables
 
-		var numberOfVertices = 0;
-		var groupStart = 0;
+		let numberOfVertices = 0;
+		let groupStart = 0;
 
 		// build each side of the box geometry
 
@@ -95,32 +95,32 @@ class BoxBufferGeometry extends BufferGeometry {
 
 		function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {
 
-			var segmentWidth = width / gridX;
-			var segmentHeight = height / gridY;
+			const segmentWidth = width / gridX;
+			const segmentHeight = height / gridY;
 
-			var widthHalf = width / 2;
-			var heightHalf = height / 2;
-			var depthHalf = depth / 2;
+			const widthHalf = width / 2;
+			const heightHalf = height / 2;
+			const depthHalf = depth / 2;
 
-			var gridX1 = gridX + 1;
-			var gridY1 = gridY + 1;
+			const gridX1 = gridX + 1;
+			const gridY1 = gridY + 1;
 
-			var vertexCounter = 0;
-			var groupCount = 0;
+			let vertexCounter = 0;
+			let groupCount = 0;
 
-			var ix, iy;
+			let ix, iy;
 
-			var vector = new Vector3();
+			const vector = new Vector3();
 
 			// generate vertices, normals and uvs
 
 			for ( iy = 0; iy < gridY1; iy ++ ) {
 
-				var y = iy * segmentHeight - heightHalf;
+				let y = iy * segmentHeight - heightHalf;
 
 				for ( ix = 0; ix < gridX1; ix ++ ) {
 
-					var x = ix * segmentWidth - widthHalf;
+					let x = ix * segmentWidth - widthHalf;
 
 					// set values to correct vector component
 
@@ -165,10 +165,10 @@ class BoxBufferGeometry extends BufferGeometry {
 
 				for ( ix = 0; ix < gridX; ix ++ ) {
 
-					var a = numberOfVertices + ix + gridX1 * iy;
-					var b = numberOfVertices + ix + gridX1 * ( iy + 1 );
-					var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );
-					var d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;
+					let a = numberOfVertices + ix + gridX1 * iy;
+					let b = numberOfVertices + ix + gridX1 * ( iy + 1 );
+					let c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );
+					let d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;
 
 					// faces