提交 2d95f415 编写于 作者: T Takahiro

GLTFLoader: Fix geometries order

上级 fe648408
......@@ -2052,7 +2052,6 @@ THREE.GLTFLoader = ( function () {
return this.getDependencies( 'accessor' ).then( function ( accessors ) {
var geometries = [];
var pending = [];
for ( var i = 0, il = primitives.length; i < il; i ++ ) {
......@@ -2067,11 +2066,7 @@ THREE.GLTFLoader = ( function () {
if ( cached ) {
// Use the cached geometry if it exists
pending.push( cached.then( function ( geometry ) {
geometries.push( geometry );
} ) );
pending.push( cached );
} else if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) {
......@@ -2082,8 +2077,6 @@ THREE.GLTFLoader = ( function () {
addPrimitiveAttributes( geometry, primitive, accessors );
geometries.push( geometry );
return geometry;
} );
......@@ -2099,25 +2092,23 @@ THREE.GLTFLoader = ( function () {
addPrimitiveAttributes( geometry, primitive, accessors );
var geometryPromise = Promise.resolve( geometry );
// Cache this geometry
cache.push( {
primitive: primitive,
promise: Promise.resolve( geometry )
promise: geometryPromise
} );
geometries.push( geometry );
pending.push( geometryPromise );
}
}
return Promise.all( pending ).then( function () {
return geometries;
} );
return Promise.all( pending );
} );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册