(assets, loading_icon_color = "white")
| 22 | |
| 23 | // preload splats, returning a map [filename -> SplatMesh] |
| 24 | export async function preloadSplats(assets, loading_icon_color = "white") { |
| 25 | addLoader(loading_icon_color); |
| 26 | const map = {}; |
| 27 | await Promise.all( |
| 28 | assets.map(async (asset) => { |
| 29 | const splatURL = await getAssetFileURL(asset); |
| 30 | return new Promise((resolve) => { |
| 31 | map[asset] = new SplatMesh({ |
| 32 | url: splatURL, |
| 33 | onLoad: () => resolve(), |
| 34 | }); |
| 35 | }); |
| 36 | }), |
| 37 | ); |
| 38 | |
| 39 | removeLoader(); |
| 40 | return map; |
| 41 | } |
nothing calls this directly
no test coverage detected