Skip to content

Commit 6e15d62

Browse files
committed
Examples: Clean up.
1 parent b6f1fe7 commit 6e15d62

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

examples/js/loaders/GLTFLoader.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ THREE.GLTFLoader = ( function () {
600600
var scale = extension.clearcoatNormalTexture.scale;
601601

602602
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
603-
materialParams.clearcoatNormalScale = new THREE.Vector2( scale, -scale );
603+
materialParams.clearcoatNormalScale = new THREE.Vector2( scale, - scale );
604604

605605
}
606606

@@ -2357,14 +2357,11 @@ THREE.GLTFLoader = ( function () {
23572357
*/
23582358
GLTFParser.prototype.loadTexture = function ( textureIndex ) {
23592359

2360-
var parser = this;
23612360
var json = this.json;
23622361
var options = this.options;
23632362

23642363
var textureDef = json.textures[ textureIndex ];
23652364

2366-
var textureExtensions = textureDef.extensions || {};
2367-
23682365
var source;
23692366

23702367
source = json.images[ textureDef.source ];
@@ -2622,8 +2619,8 @@ THREE.GLTFLoader = ( function () {
26222619
cachedMaterial.vertexTangents = true;
26232620

26242621
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
2625-
if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= -1;
2626-
if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= -1;
2622+
if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;
2623+
if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1;
26272624

26282625
}
26292626

@@ -2766,11 +2763,11 @@ THREE.GLTFLoader = ( function () {
27662763
pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );
27672764

27682765
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
2769-
materialParams.normalScale = new THREE.Vector2( 1, -1 );
2766+
materialParams.normalScale = new THREE.Vector2( 1, - 1 );
27702767

27712768
if ( materialDef.normalTexture.scale !== undefined ) {
27722769

2773-
materialParams.normalScale.set( materialDef.normalTexture.scale, -materialDef.normalTexture.scale );
2770+
materialParams.normalScale.set( materialDef.normalTexture.scale, - materialDef.normalTexture.scale );
27742771

27752772
}
27762773

examples/jsm/loaders/GLTFLoader.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ var GLTFLoader = ( function () {
665665
var scale = extension.clearcoatNormalTexture.scale;
666666

667667
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
668-
materialParams.clearcoatNormalScale = new Vector2( scale, -scale );
668+
materialParams.clearcoatNormalScale = new Vector2( scale, - scale );
669669

670670
}
671671

@@ -2422,14 +2422,11 @@ var GLTFLoader = ( function () {
24222422
*/
24232423
GLTFParser.prototype.loadTexture = function ( textureIndex ) {
24242424

2425-
var parser = this;
24262425
var json = this.json;
24272426
var options = this.options;
24282427

24292428
var textureDef = json.textures[ textureIndex ];
24302429

2431-
var textureExtensions = textureDef.extensions || {};
2432-
24332430
var source;
24342431

24352432
source = json.images[ textureDef.source ];
@@ -2687,8 +2684,8 @@ var GLTFLoader = ( function () {
26872684
cachedMaterial.vertexTangents = true;
26882685

26892686
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
2690-
if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= -1;
2691-
if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= -1;
2687+
if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;
2688+
if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1;
26922689

26932690
}
26942691

@@ -2831,11 +2828,11 @@ var GLTFLoader = ( function () {
28312828
pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );
28322829

28332830
// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995
2834-
materialParams.normalScale = new Vector2( 1, -1 );
2831+
materialParams.normalScale = new Vector2( 1, - 1 );
28352832

28362833
if ( materialDef.normalTexture.scale !== undefined ) {
28372834

2838-
materialParams.normalScale.set( materialDef.normalTexture.scale, -materialDef.normalTexture.scale );
2835+
materialParams.normalScale.set( materialDef.normalTexture.scale, - materialDef.normalTexture.scale );
28392836

28402837
}
28412838

0 commit comments

Comments
 (0)