Garrett Johnson 3 лет назад
Родитель
Сommit
561edea098

+ 1 - 2
.eslintrc.json

@@ -19,7 +19,6 @@
 				"ignoreReadBeforeAssign": false
 			}
 		],
-		"quotes": [ "error", "single" ],
-		"indent": [ "error", "tab" ]
+		"quotes": [ "error", "single" ]
 	}
 }

+ 1 - 1
example/customMaterial.js

@@ -318,7 +318,7 @@ function updateOrthoCamera() {
 	orthoCamera.rotation.copy( camera.rotation );
 
 	const scale = camera.position.distanceTo( controls.target ) / 2.0;
-	let aspect = window.innerWidth / window.innerHeight;
+	const aspect = window.innerWidth / window.innerHeight;
 	orthoCamera.left = - aspect * scale;
 	orthoCamera.right = aspect * scale;
 	orthoCamera.bottom = - scale;

+ 1 - 1
example/index.js

@@ -50,7 +50,7 @@ let raycaster, mouse, rayIntersect, lastHoveredElement;
 let offsetParent;
 let statsContainer, stats;
 
-let params = {
+const params = {
 
 	'enableUpdate': true,
 	'raycast': NONE,

+ 1 - 1
example/ionExample.js

@@ -50,7 +50,7 @@ let raycaster, mouse, rayIntersect, lastHoveredElement;
 let offsetParent;
 let statsContainer, stats;
 
-let params = {
+const params = {
 
 	'enableUpdate': true,
 	'raycast': NONE,

+ 1 - 1
example/offscreenShadows.js

@@ -159,7 +159,7 @@ function updateOrthoCamera() {
 	orthoCamera.rotation.copy( camera.rotation );
 
 	const scale = camera.position.distanceTo( controls.target ) / 2.0;
-	let aspect = window.innerWidth / window.innerHeight;
+	const aspect = window.innerWidth / window.innerHeight;
 	orthoCamera.left = - aspect * scale;
 	orthoCamera.right = aspect * scale;
 	orthoCamera.bottom = - scale;

+ 2 - 2
example/vr.js

@@ -43,10 +43,10 @@ let raycaster, fwdVector, intersectRing;
 let offsetParent;
 let controller, controllerGrip;
 let xrSession = null;
-let tasks = [];
+const tasks = [];
 const upVector = new Vector3( 0, 1, 0 );
 
-let params = {
+const params = {
 
 	'displayBoxBounds': false,
 	'colorMode': 0,

+ 1 - 1
src/base/PNTSLoaderBase.js

@@ -1,7 +1,7 @@
 // PNTS File Format
 // https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md
 
-import { FeatureTable, BatchTable } from "../utilities/FeatureTable.js";
+import { FeatureTable, BatchTable } from '../utilities/FeatureTable.js';
 import { LoaderBase } from './LoaderBase.js';
 
 export class PNTSLoaderBase extends LoaderBase {

+ 1 - 1
src/base/traverseFunctions.js

@@ -303,7 +303,7 @@ export function skipTraversal( tile, renderer ) {
 	const loadedContent = isDownloadFinished( tile.__loadingState ) && hasContent;
 	const childrenWereVisible = tile.__childrenWereVisible;
 	const children = tile.children;
-	let allChildrenHaveContent = tile.__allChildrenLoaded;
+	const allChildrenHaveContent = tile.__allChildrenLoaded;
 
 	// Increment the relative depth of the node to the nearest rendered parent if it has content
 	// and is being rendered.

+ 2 - 3
src/three/TilesRenderer.js

@@ -364,9 +364,8 @@ export class TilesRenderer extends TilesRendererBase {
 		// extract scale of group container
 		tempMat2.copy( group.matrixWorld ).invert();
 
-		let invScale;
 		tempVector.setFromMatrixScale( tempMat2 );
-		invScale = tempVector.x;
+		const invScale = tempVector.x;
 
 		if ( Math.abs( Math.max( tempVector.x - tempVector.y, tempVector.x - tempVector.z ) ) > 1e-6 ) {
 
@@ -536,7 +535,7 @@ export class TilesRenderer extends TilesRendererBase {
 
 		}
 
-		let region = null;
+		const region = null;
 		if ( 'region' in tile.boundingVolume ) {
 
 			console.warn( 'ThreeTilesRenderer: region bounding volume not supported.' );

+ 2 - 3
src/three/raycastTraverse.js

@@ -90,9 +90,8 @@ export function raycastTraverseFirstHit( root, group, activeTiles, raycaster ) {
 			if ( _ray.intersectBox( boundingBox, _vec ) ) {
 
 				// account for tile scale
-				let invScale;
 				_vec2.setFromMatrixScale( _mat );
-				invScale = _vec2.x;
+				const invScale = _vec2.x;
 
 				if ( Math.abs( Math.max( _vec2.x - _vec2.y, _vec2.x - _vec2.z ) ) > 1e-6 ) {
 
@@ -101,7 +100,7 @@ export function raycastTraverseFirstHit( root, group, activeTiles, raycaster ) {
 				}
 
 				// if we intersect the box save the distance to the tile bounds
-				let data = {
+				const data = {
 					distance: Infinity,
 					tile: null
 				};