Skip to content

Commit

Permalink
fix: glTF parser error and test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxudong committed Aug 31, 2023
1 parent 8adb519 commit 0fcb02a
Show file tree
Hide file tree
Showing 3 changed files with 275 additions and 261 deletions.
4 changes: 3 additions & 1 deletion packages/loader/src/gltf/parser/GLTFEntityParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class GLTFEntityParser extends GLTFParser {
parse(context: GLTFParserContext, index: number): Entity {
const entityInfo = context.glTF.nodes[index];
const engine = context.glTFResource.engine;
const { matrix, translation, rotation, scale } = entityInfo;
const { matrix, translation, rotation, scale, extensions } = entityInfo;
const entity = new Entity(engine, entityInfo.name || `_GLTF_ENTITY_${index}`);

const { transform } = entity;
Expand Down Expand Up @@ -37,6 +37,8 @@ export class GLTFEntityParser extends GLTFParser {
}
}

GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);

return entity;
}
}
4 changes: 1 addition & 3 deletions packages/loader/src/gltf/parser/GLTFSceneParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class GLTFSceneParser extends GLTFParser {
private _parseEntityComponent(context: GLTFParserContext, index: number): Promise<void[]> {
const { glTF, glTFResource } = context;
const entityInfo = glTF.nodes[index];
const { camera: cameraID, mesh: meshID, extensions } = entityInfo;
const { camera: cameraID, mesh: meshID } = entityInfo;
const entity = context.get<Entity>(GLTFParserType.Entity, index);
let promise: Promise<void[]>;

Expand All @@ -101,8 +101,6 @@ export class GLTFSceneParser extends GLTFParser {
}
}

GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, entity, entityInfo);

return Promise.all(promises);
});
}
Expand Down
Loading

0 comments on commit 0fcb02a

Please sign in to comment.