Skip to content

Commit 889a39d

Browse files
committed
Clean up.
1 parent cd704f2 commit 889a39d

File tree

9 files changed

+41
-38
lines changed

9 files changed

+41
-38
lines changed

examples/jsm/inspector/ui/Profiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export class Profiler {
444444
// Create a button for the builtin tab in the profiler-toggle
445445
const builtinButton = document.createElement( 'button' );
446446
builtinButton.className = 'builtin-tab-btn';
447-
447+
448448
// Use icon if provided, otherwise use first letter
449449
if ( tab.icon ) {
450450

examples/jsm/loaders/DRACOLoader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ function DRACOWorker() {
667667
const srcByteStride = itemSize * TypedArray.BYTES_PER_ELEMENT;
668668
const dstByteStride = Math.ceil( srcByteStride / 4 ) * 4;
669669

670-
const dstStride = dstByteStride / TypedArray.BYTES_PER_ELEMENT
670+
const dstStride = dstByteStride / TypedArray.BYTES_PER_ELEMENT;
671671

672672
const srcByteLength = count * srcByteStride;
673673
const dstByteLength = count * dstByteStride;
@@ -690,13 +690,13 @@ function DRACOWorker() {
690690

691691
dstArray = new TypedArray( dstByteLength / TypedArray.BYTES_PER_ELEMENT );
692692

693-
let dstOffset = 0
693+
let dstOffset = 0;
694694

695-
for ( let i = 0, il = srcArray.length; i < il; i++ ) {
695+
for ( let i = 0, il = srcArray.length; i < il; i ++ ) {
696696

697-
for ( let j = 0; j < itemSize; j++ ) {
697+
for ( let j = 0; j < itemSize; j ++ ) {
698698

699-
dstArray[ dstOffset + j ] = srcArray[ i * itemSize + j ]
699+
dstArray[ dstOffset + j ] = srcArray[ i * itemSize + j ];
700700

701701
}
702702

examples/jsm/materials/WoodNodeMaterial.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,79 +297,79 @@ const woodParams = {
297297
teak: {
298298
transformationMatrix: new THREE.Matrix4().identity(),
299299
centerSize: 1.11, largeWarpScale: 0.32, largeGrainStretch: 0.24, smallWarpStrength: 0.059,
300-
smallWarpScale: 2, fineWarpStrength: 0.006, fineWarpScale: 32.8, ringThickness: 1/34,
300+
smallWarpScale: 2, fineWarpStrength: 0.006, fineWarpScale: 32.8, ringThickness: 1 / 34,
301301
ringBias: 0.03, ringSizeVariance: 0.03, ringVarianceScale: 4.4, barkThickness: 0.3,
302302
splotchScale: 0.2, splotchIntensity: 0.541, cellScale: 910, cellSize: 0.1,
303303
darkGrainColor: '#0c0504', lightGrainColor: '#926c50'
304304
},
305305
walnut: {
306306
transformationMatrix: new THREE.Matrix4().identity(),
307307
centerSize: 1.07, largeWarpScale: 0.42, largeGrainStretch: 0.34, smallWarpStrength: 0.016,
308-
smallWarpScale: 10.3, fineWarpStrength: 0.028, fineWarpScale: 12.7, ringThickness: 1/32,
308+
smallWarpScale: 10.3, fineWarpStrength: 0.028, fineWarpScale: 12.7, ringThickness: 1 / 32,
309309
ringBias: 0.08, ringSizeVariance: 0.03, ringVarianceScale: 5.5, barkThickness: 0.98,
310310
splotchScale: 1.84, splotchIntensity: 0.97, cellScale: 710, cellSize: 0.31,
311311
darkGrainColor: '#311e13', lightGrainColor: '#523424'
312312
},
313313
white_oak: {
314314
transformationMatrix: new THREE.Matrix4().identity(),
315315
centerSize: 1.23, largeWarpScale: 0.21, largeGrainStretch: 0.21, smallWarpStrength: 0.034,
316-
smallWarpScale: 2.44, fineWarpStrength: 0.01, fineWarpScale: 14.3, ringThickness: 1/34,
316+
smallWarpScale: 2.44, fineWarpStrength: 0.01, fineWarpScale: 14.3, ringThickness: 1 / 34,
317317
ringBias: 0.82, ringSizeVariance: 0.16, ringVarianceScale: 1.4, barkThickness: 0.7,
318318
splotchScale: 0.2, splotchIntensity: 0.541, cellScale: 800, cellSize: 0.28,
319319
darkGrainColor: '#8b4c21', lightGrainColor: '#c57e43'
320320
},
321321
pine: {
322322
transformationMatrix: new THREE.Matrix4().identity(),
323323
centerSize: 1.23, largeWarpScale: 0.21, largeGrainStretch: 0.18, smallWarpStrength: 0.041,
324-
smallWarpScale: 2.44, fineWarpStrength: 0.006, fineWarpScale: 23.2, ringThickness: 1/24,
324+
smallWarpScale: 2.44, fineWarpStrength: 0.006, fineWarpScale: 23.2, ringThickness: 1 / 24,
325325
ringBias: 0.1, ringSizeVariance: 0.07, ringVarianceScale: 5, barkThickness: 0.35,
326326
splotchScale: 0.51, splotchIntensity: 3.32, cellScale: 1480, cellSize: 0.07,
327327
darkGrainColor: '#c58355', lightGrainColor: '#d19d61'
328328
},
329329
poplar: {
330330
transformationMatrix: new THREE.Matrix4().identity(),
331331
centerSize: 1.43, largeWarpScale: 0.33, largeGrainStretch: 0.18, smallWarpStrength: 0.04,
332-
smallWarpScale: 4.3, fineWarpStrength: 0.004, fineWarpScale: 33.6, ringThickness: 1/37,
332+
smallWarpScale: 4.3, fineWarpStrength: 0.004, fineWarpScale: 33.6, ringThickness: 1 / 37,
333333
ringBias: 0.07, ringSizeVariance: 0.03, ringVarianceScale: 3.8, barkThickness: 0.3,
334334
splotchScale: 1.92, splotchIntensity: 0.71, cellScale: 830, cellSize: 0.04,
335335
darkGrainColor: '#716347', lightGrainColor: '#998966'
336336
},
337337
maple: {
338338
transformationMatrix: new THREE.Matrix4().identity(),
339339
centerSize: 1.4, largeWarpScale: 0.38, largeGrainStretch: 0.25, smallWarpStrength: 0.067,
340-
smallWarpScale: 2.5, fineWarpStrength: 0.005, fineWarpScale: 33.6, ringThickness: 1/35,
340+
smallWarpScale: 2.5, fineWarpStrength: 0.005, fineWarpScale: 33.6, ringThickness: 1 / 35,
341341
ringBias: 0.1, ringSizeVariance: 0.07, ringVarianceScale: 4.6, barkThickness: 0.61,
342342
splotchScale: 0.46, splotchIntensity: 1.49, cellScale: 800, cellSize: 0.03,
343343
darkGrainColor: '#b08969', lightGrainColor: '#bc9d7d'
344344
},
345345
red_oak: {
346346
transformationMatrix: new THREE.Matrix4().identity(),
347347
centerSize: 1.21, largeWarpScale: 0.24, largeGrainStretch: 0.25, smallWarpStrength: 0.044,
348-
smallWarpScale: 2.54, fineWarpStrength: 0.01, fineWarpScale: 14.5, ringThickness: 1/34,
348+
smallWarpScale: 2.54, fineWarpStrength: 0.01, fineWarpScale: 14.5, ringThickness: 1 / 34,
349349
ringBias: 0.92, ringSizeVariance: 0.03, ringVarianceScale: 5.6, barkThickness: 1.01,
350350
splotchScale: 0.28, splotchIntensity: 3.48, cellScale: 800, cellSize: 0.25,
351351
darkGrainColor: '#af613b', lightGrainColor: '#e0a27a'
352352
},
353353
cherry: {
354354
transformationMatrix: new THREE.Matrix4().identity(),
355355
centerSize: 1.33, largeWarpScale: 0.11, largeGrainStretch: 0.33, smallWarpStrength: 0.024,
356-
smallWarpScale: 2.48, fineWarpStrength: 0.01, fineWarpScale: 15.3, ringThickness: 1/36,
356+
smallWarpScale: 2.48, fineWarpStrength: 0.01, fineWarpScale: 15.3, ringThickness: 1 / 36,
357357
ringBias: 0.02, ringSizeVariance: 0.04, ringVarianceScale: 6.5, barkThickness: 0.09,
358358
splotchScale: 1.27, splotchIntensity: 1.24, cellScale: 1530, cellSize: 0.15,
359359
darkGrainColor: '#913f27', lightGrainColor: '#b45837'
360360
},
361361
cedar: {
362362
transformationMatrix: new THREE.Matrix4().identity(),
363363
centerSize: 1.11, largeWarpScale: 0.39, largeGrainStretch: 0.12, smallWarpStrength: 0.061,
364-
smallWarpScale: 1.9, fineWarpStrength: 0.006, fineWarpScale: 4.8, ringThickness: 1/25,
364+
smallWarpScale: 1.9, fineWarpStrength: 0.006, fineWarpScale: 4.8, ringThickness: 1 / 25,
365365
ringBias: 0.01, ringSizeVariance: 0.07, ringVarianceScale: 6.7, barkThickness: 0.1,
366366
splotchScale: 0.61, splotchIntensity: 2.54, cellScale: 630, cellSize: 0.19,
367367
darkGrainColor: '#9a5b49', lightGrainColor: '#ae745e'
368368
},
369369
mahogany: {
370370
transformationMatrix: new THREE.Matrix4().identity(),
371371
centerSize: 1.25, largeWarpScale: 0.26, largeGrainStretch: 0.29, smallWarpStrength: 0.044,
372-
smallWarpScale: 2.54, fineWarpStrength: 0.01, fineWarpScale: 15.3, ringThickness: 1/38,
372+
smallWarpScale: 2.54, fineWarpStrength: 0.01, fineWarpScale: 15.3, ringThickness: 1 / 38,
373373
ringBias: 0.01, ringSizeVariance: 0.33, ringVarianceScale: 1.2, barkThickness: 0.07,
374374
splotchScale: 0.77, splotchIntensity: 1.39, cellScale: 1400, cellSize: 0.23,
375375
darkGrainColor: '#501d12', lightGrainColor: '#6d3722'
@@ -433,7 +433,7 @@ uniforms.lightGrainColor = TSL.uniform( new THREE.Color( params.lightGrainColor
433433
uniforms.transformationMatrix = TSL.uniform( new THREE.Matrix4().copy( params.transformationMatrix ) ).onObjectUpdate( ( { material } ) => material.transformationMatrix );
434434

435435
const colorNode = wood(
436-
uniforms.transformationMatrix.mul( TSL.vec4(TSL.positionLocal, 1) ).xyz,
436+
uniforms.transformationMatrix.mul( TSL.vec4( TSL.positionLocal, 1 ) ).xyz,
437437
uniforms.centerSize,
438438
uniforms.largeWarpScale,
439439
uniforms.largeGrainStretch,

examples/jsm/renderers/Projector.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Projector {
172172
{ sign: + 1 },
173173
{ sign: - 1 }
174174
];
175-
175+
176176
//
177177

178178
function RenderList() {
@@ -348,7 +348,7 @@ class Projector {
348348
_face.v3.copy( v3 );
349349
_face.z = ( v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z ) / 3;
350350
_face.renderOrder = object.renderOrder;
351-
351+
352352
// face normal
353353
_vector3.subVectors( v3.position, v2.position );
354354
_vector4.subVectors( v1.position, v2.position );
@@ -397,7 +397,7 @@ class Projector {
397397
for ( let i = 0; i < clippedCount; i ++ ) {
398398

399399
const cv = _clipInput[ i ];
400-
400+
401401
// Get or create renderable vertex from pool
402402
let sv = _screenVertexPool[ i ];
403403
if ( ! sv ) {
@@ -1095,7 +1095,7 @@ class Projector {
10951095
return inputCount;
10961096

10971097
}
1098-
1098+
10991099
function clipLine( s1, s2 ) {
11001100

11011101
let alpha1 = 0, alpha2 = 1;

examples/webgl_geometry_text_stroke.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
new THREE.FileLoader()
5454
.setResponseType( 'arraybuffer' )
5555
.load( 'fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip', function ( data ) {
56+
5657
const zip = unzipSync( new Uint8Array( data ) );
5758
const strArray = strFromU8( new Uint8Array( zip[ 'MPLUSRounded1c-Regular.typeface.json' ].buffer ) );
5859

@@ -101,7 +102,7 @@
101102

102103
render();
103104

104-
} ); //end load function
105+
} ); //end load function
105106

106107
renderer = new THREE.WebGLRenderer( { antialias: true } );
107108
renderer.setPixelRatio( window.devicePixelRatio );
@@ -118,7 +119,7 @@
118119

119120
} // end init
120121

121-
function generateStrokeText(font, material, message, size, direction = 'ltr') {
122+
function generateStrokeText( font, material, message, size, direction = 'ltr' ) {
122123

123124
const shapes = font.generateShapes( message, size, direction );
124125

@@ -138,7 +139,7 @@
138139

139140
text.position.z = - 150;
140141

141-
strokeText.add(text);
142+
strokeText.add( text );
142143

143144
// make line shape ( N.B. edge view remains visible )
144145

examples/webgl_loader_gltf_animation_pointer.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
scene.environment = pmremGenerator.fromScene( new RoomEnvironment(), 0.04 ).texture;
7171

7272
const camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, .2, 100 );
73-
camera.position.set( -3, 2, 6 );
73+
camera.position.set( - 3, 2, 6 );
7474

7575
const controls = new OrbitControls( camera, renderer.domElement );
7676
controls.target.set( 0, 0.5, 0 );
@@ -90,9 +90,11 @@
9090
loader.setDRACOLoader( dracoLoader );
9191
loader.setKTX2Loader( ktx2Loader );
9292

93-
loader.register(p => {
94-
return new GLTFAnimationPointerExtension(p);
95-
});
93+
loader.register( p => {
94+
95+
return new GLTFAnimationPointerExtension( p );
96+
97+
} );
9698

9799
loader.load( 'https://cloud.needle.tools/-/assets/Z23hmXB27L6Db-optimized/file', function ( gltf ) {
98100

examples/webgl_materials_envmaps_fasthdr.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120

121121
}
122122

123-
loadTexture( "https://cdn.needle.tools/static/hdris/ballroom_2k.pmrem.ktx2" );
123+
loadTexture( 'https://cdn.needle.tools/static/hdris/ballroom_2k.pmrem.ktx2' );
124124

125125
stats = new Stats();
126126
container.appendChild( stats.dom );
@@ -138,9 +138,9 @@
138138
'ballroom': 'https://cdn.needle.tools/static/hdris/ballroom_2k.pmrem.ktx2',
139139
'brown photostudio': 'https://cdn.needle.tools/static/hdris/brown_photostudio_02_2k.pmrem.ktx2',
140140
'cape hill': 'https://cdn.needle.tools/static/hdris/cape_hill_2k.pmrem.ktx2',
141-
'cannon': "https://cdn.needle.tools/static/hdris/cannon_2k.pmrem.ktx2",
142-
'metro noord': "https://cdn.needle.tools/static/hdris/metro_noord_2k.pmrem.ktx2",
143-
'the sky is on fire': "https://cdn.needle.tools/static/hdris/the_sky_is_on_fire_2k.pmrem.ktx2",
141+
'cannon': 'https://cdn.needle.tools/static/hdris/cannon_2k.pmrem.ktx2',
142+
'metro noord': 'https://cdn.needle.tools/static/hdris/metro_noord_2k.pmrem.ktx2',
143+
'the sky is on fire': 'https://cdn.needle.tools/static/hdris/the_sky_is_on_fire_2k.pmrem.ktx2',
144144
'studio small 09': 'https://cdn.needle.tools/static/hdris/studio_small_09_2k.pmrem.ktx2',
145145
'wide street 01': 'https://cdn.needle.tools/static/hdris/wide_street_01_2k.pmrem.ktx2'
146146
} ).onChange( () => {

examples/webgpu_tsl_wood.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
const cube = new THREE.Mesh( blockGeometry, material );
224224

225225
cube.position.copy( getGridPosition( x, y ) );
226-
material.transformationMatrix = new THREE.Matrix4().setPosition( new THREE.Vector3( -0.1, 0, Math.random() ) );
226+
material.transformationMatrix = new THREE.Matrix4().setPosition( new THREE.Vector3( - 0.1, 0, Math.random() ) );
227227
base.add( cube );
228228

229229
await new Promise( resolve => setTimeout( resolve, 0 ) );
@@ -278,7 +278,7 @@
278278
smallWarpScale: 2,
279279
fineWarpStrength: 0.006,
280280
fineWarpScale: 32.8,
281-
ringThickness: 1/34,
281+
ringThickness: 1 / 34,
282282
ringBias: 0.03,
283283
ringSizeVariance: 0.03,
284284
ringVarianceScale: 4.4,
@@ -287,7 +287,7 @@
287287
splotchIntensity: 0.541,
288288
cellScale: 910,
289289
cellSize: 0.1,
290-
darkGrainColor: new THREE.Color( '#0c0504') ,
290+
darkGrainColor: new THREE.Color( '#0c0504' ),
291291
lightGrainColor: new THREE.Color( '#926c50' ),
292292
clearcoat: 1,
293293
clearcoatRoughness: 0.2
@@ -301,7 +301,7 @@
301301
gui.add( customMaterial, 'fineWarpStrength', 0.0, 0.05, 0.001 ).name( 'fineWarpStrength' );
302302
gui.add( customMaterial, 'fineWarpScale', 0.0, 50.0, 0.1 ).name( 'fineWarpScale' );
303303
gui.add( customMaterial, 'ringThickness', 0.0, 0.1, 0.001 ).name( 'ringThickness' );
304-
gui.add( customMaterial, 'ringBias', -0.2, 0.2, 0.001 ).name( 'ringBias' );
304+
gui.add( customMaterial, 'ringBias', - 0.2, 0.2, 0.001 ).name( 'ringBias' );
305305
gui.add( customMaterial, 'ringSizeVariance', 0.0, 0.2, 0.001 ).name( 'ringSizeVariance' );
306306
gui.add( customMaterial, 'ringVarianceScale', 0.0, 10.0, 0.1 ).name( 'ringVarianceScale' );
307307
gui.add( customMaterial, 'barkThickness', 0.0, 1.0, 0.01 ).name( 'barkThickness' );
@@ -316,7 +316,7 @@
316316

317317
const cube = new THREE.Mesh( blockGeometry, customMaterial );
318318

319-
customMaterial.transformationMatrix = new THREE.Matrix4().setPosition( new THREE.Vector3( -0.1, 0, Math.random() ) );
319+
customMaterial.transformationMatrix = new THREE.Matrix4().setPosition( new THREE.Vector3( - 0.1, 0, Math.random() ) );
320320
cube.position.copy( getGridPosition( Math.round( WoodGenuses.length / 2 ), 5 ) );
321321

322322
base.add( cube );

examples/webxr_xr_paint.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
this.userData.isSqueezing = true;
109109
this.userData.positionAtSqueezeStart = this.position.y;
110-
110+
111111
const pivot = this.getObjectByName( 'pivot' );
112112
this.userData.scaleAtSqueezeStart = pivot.scale.x;
113113

0 commit comments

Comments
 (0)