FBXLoader修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function loadTexture( textureNode, loader, images, connections ) {

var fileName;

var currentPath = loader.path;
var children = connections.get( textureNode.id ).children;

if ( children !== undefined && children.length > 0 && images[ children[ 0 ].ID ] !== undefined ) {

fileName = images[ children[ 0 ].ID ];

if ( fileName.indexOf( 'blob:' ) === 0 || fileName.indexOf( 'data:' ) === 0 ) {

loader.setPath( undefined );

}

}

var texture;

if ( textureNode.FileName.slice( -3 ).toLowerCase() === 'tga' ) {
//texture = THREE.Loader.Handlers.get( '.tga' ).load( fileName );
texture = THREE.Loader.Handlers.get( '.tga' ).load( currentPath+textureNode.FileName );
} else {

texture = loader.load( currentPath+'/'+textureNode.FileName );

}

loader.setPath( currentPath );

return texture;

}