From b000372cc424fa46c1b7ebb1f5f20e2396f1ce83 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Mon, 9 Oct 2017 18:35:45 -0700 Subject: [PATCH] GLTFLoader: Keep uvScaleMap updates backwards-compatible. --- examples/js/loaders/GLTFLoader.js | 34 +++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index a014837564..ea37082f2b 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -760,18 +760,36 @@ THREE.GLTFLoader = ( function () { } - if ( uvScaleMap.matrixAutoUpdate === true ) { + var offset; + var repeat; - var offset = uvScaleMap.offset; - var repeat = uvScaleMap.repeat; - var rotation = uvScaleMap.rotation; - var center = uvScaleMap.center; + if ( uvScaleMap.matrix !== undefined ) { - uvScaleMap.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, center.x, center.y ); + // > r88. - } + if ( uvScaleMap.matrixAutoUpdate === true ) { + + offset = uvScaleMap.offset; + repeat = uvScaleMap.repeat; + var rotation = uvScaleMap.rotation; + var center = uvScaleMap.center; + + uvScaleMap.matrix.setUvTransform( offset.x, offset.y, repeat.x, repeat.y, rotation, center.x, center.y ); + + } + + uniforms.uvTransform.value.copy( uvScaleMap.matrix ); - uniforms.uvTransform.value.copy( uvScaleMap.matrix ); + } else { + + // <= r87. Remove when reasonable. + + offset = uvScaleMap.offset; + repeat = uvScaleMap.repeat; + + uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y ); + + } } -- GitLab