Skip to content

Commit d3e3191

Browse files
author
Don McCurdy
committed
GLTFLoader: Clean up.
1 parent 73160fe commit d3e3191

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/js/loaders/GLTFLoader.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,7 @@ THREE.GLTFLoader = ( function () {
579579

580580
}
581581

582-
GLTFTextureTransformExtension.prototype.extendTexture = function ( texture, mapDef ) {
583-
584-
var transform = mapDef.extensions !== undefined ? mapDef.extensions[ this.name ] : undefined;
585-
586-
if ( transform === undefined ) return texture;
582+
GLTFTextureTransformExtension.prototype.extendTexture = function ( texture, transform ) {
587583

588584
texture = texture.clone();
589585

@@ -2212,7 +2208,13 @@ THREE.GLTFLoader = ( function () {
22122208

22132209
if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {
22142210

2215-
texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, mapDef );
2211+
var transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;
2212+
2213+
if ( transform ) {
2214+
2215+
texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform );
2216+
2217+
}
22162218

22172219
}
22182220

0 commit comments

Comments
 (0)