@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / acquireSharedModel
Function: acquireSharedModel() ​
ts
function acquireSharedModel(url, load): Promise<{
gltf: GLTF;
object: Object3D;
}>;Defined in: utils/modelCache.ts:214
Load the model at url once and hand out a copy to mount. Every copy shares the load's geometry and textures and has its own materials. Give each copy back with releaseSharedModel when it's no longer used; the load is freed once no copy is left. A failed load is forgotten, so a retry fetches.
Parameters ​
| Parameter | Type |
|---|---|
url | string |
load | () => Promise<GLTF> |
Returns ​
Promise<{ gltf: GLTF; object: Object3D; }>

