Jelajahi Sumber

GLTFLoader: Clean up UV matrix update.

Don McCurdy 7 tahun lalu
induk
melakukan
fb53823b66
1 mengubah file dengan 4 tambahan dan 27 penghapusan
  1. 4 27
      examples/js/loaders/GLTFLoader.js

+ 4 - 27
examples/js/loaders/GLTFLoader.js

@@ -851,37 +851,14 @@ THREE.GLTFLoader = ( function () {
 
 					}
 
-					var offset;
-					var repeat;
+					if ( uvScaleMap.matrixAutoUpdate === true ) {
 
-					if ( uvScaleMap.matrix !== undefined ) {
-
-						// > 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 );
-
-					} else {
-
-						// <= r87. Remove when reasonable.
-
-						offset = uvScaleMap.offset;
-						repeat = uvScaleMap.repeat;
-
-						uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );
+						uvScaleMap.updateMatrix();
 
 					}
 
+					uniforms.uvTransform.value.copy( uvScaleMap.matrix );
+
 				}
 
 				uniforms.envMap.value = material.envMap;