(path: string)
| 722 | declare function bloom_commit_model(handle: number): number; |
| 723 | |
| 724 | export async function loadModelAsync(path: string): Promise<Model> { |
| 725 | const pathLower = (path as string).toLowerCase(); |
| 726 | if (pathLower.endsWith('.obj')) { |
| 727 | const parsed = await spawn(() => { |
| 728 | const text: string = bloom_read_file(path as any) as any; |
| 729 | return text ? parseOBJ(text) : null; |
| 730 | }); |
| 731 | if (parsed) { |
| 732 | const handle = bloom_create_mesh( |
| 733 | parsed.vertices as any, |
| 734 | parsed.vertices.length / 12, |
| 735 | parsed.indices as any, |
| 736 | parsed.indices.length, |
| 737 | ); |
| 738 | return makeModel(handle, 1, 1); |
| 739 | } |
| 740 | return makeModel(0); |
| 741 | } |
| 742 | const stagingHandle = await spawn(() => bloom_stage_model(path as any)); |
| 743 | const handle = bloom_commit_model(stagingHandle); |
| 744 | return makeModel(handle); |
| 745 | } |
| 746 | |
| 747 | export function stageModels(paths: string[]): number[] { |
| 748 | return parallelMap(paths, (path: string) => bloom_stage_model(path as any)); |
nothing calls this directly
no test coverage detected