瀏覽代碼

GLTFLoader: Keep uvScaleMap updates backwards-compatible.

Don McCurdy 7 年之前
父節點
當前提交
b000372cc4
共有 1 個文件被更改,包括 26 次插入8 次删除
  1. 26 8
      examples/js/loaders/GLTFLoader.js

+ 26 - 8
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 );
+
+					}
 
 
 				}
 				}