parse method
Implementation
Future<GLTFData> parse() async {
final parser = this;
final json = this.json;
final extensions = this.extensions;
// Clear the loader cache
cache.removeAll();
// Mark the special nodes/meshes in json for efficient parse
_invokeAll((ext) {
return ext?.markDefs != null && ext?.markDefs?.call() != null;
});
final scenes = await getDependencies('scene');
final animations = await getDependencies('animation');
final cameras = await getDependencies('camera');
final result = GLTFData(
scene: scenes[json["scene"] ?? 0],
scenes: scenes,
animations: animations as List?,
cameras: cameras as List?,
asset: json["asset"],
parser: parser,
userData: {}
);
addUnknownExtensionsToUserData(extensions, result, json);
assignExtrasToUserData(result, json);
for (final scene in result.scenes ) {
scene.updateMatrixWorld();
}
return result;
}