提交 8ab45291 编写于 作者: M Mugen87

Avoid multiple textureLoaders in for-loops

上级 6857b6d5
...@@ -223,13 +223,13 @@ THREE.MD2Character = function () { ...@@ -223,13 +223,13 @@ THREE.MD2Character = function () {
function loadTextures( baseUrl, textureUrls ) { function loadTextures( baseUrl, textureUrls ) {
var mapping = THREE.UVMapping; var textureLoader = new THREE.TextureLoader();
var textures = []; var textures = [];
for ( var i = 0; i < textureUrls.length; i ++ ) { for ( var i = 0; i < textureUrls.length; i ++ ) {
textures[ i ] = new THREE.TextureLoader().load( baseUrl + textureUrls[ i ], checkLoadingComplete ); textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = mapping; textures[ i ].mapping = THREE.UVMapping;
textures[ i ].name = textureUrls[ i ]; textures[ i ].name = textureUrls[ i ];
} }
......
...@@ -506,13 +506,13 @@ THREE.MD2CharacterComplex = function () { ...@@ -506,13 +506,13 @@ THREE.MD2CharacterComplex = function () {
function loadTextures( baseUrl, textureUrls ) { function loadTextures( baseUrl, textureUrls ) {
var mapping = THREE.UVMapping; var textureLoader = new THREE.TextureLoader();
var textures = []; var textures = [];
for ( var i = 0; i < textureUrls.length; i ++ ) { for ( var i = 0; i < textureUrls.length; i ++ ) {
textures[ i ] = new THREE.TextureLoader().load( baseUrl + textureUrls[ i ], checkLoadingComplete ); textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], checkLoadingComplete );
textures[ i ].mapping = mapping; textures[ i ].mapping = THREE.UVMapping;
textures[ i ].name = textureUrls[ i ]; textures[ i ].name = textureUrls[ i ];
} }
......
...@@ -91,13 +91,13 @@ THREE.UCSCharacter = function() { ...@@ -91,13 +91,13 @@ THREE.UCSCharacter = function() {
function loadTextures( baseUrl, textureUrls ) { function loadTextures( baseUrl, textureUrls ) {
var mapping = THREE.UVMapping; var textureLoader = new THREE.TextureLoader();
var textures = []; var textures = [];
for ( var i = 0; i < textureUrls.length; i ++ ) { for ( var i = 0; i < textureUrls.length; i ++ ) {
textures[ i ] = new THREE.TextureLoader().load( baseUrl + textureUrls[ i ], scope.checkLoadingComplete ); textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], scope.checkLoadingComplete );
textures[ i ].mapping = mapping; textures[ i ].mapping = THREE.UVMapping;
textures[ i ].name = textureUrls[ i ]; textures[ i ].name = textureUrls[ i ];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册