asset-ref overview
Names one asset for world.loader.preload and for the assets hook of a level entity class:
the same thing the matching loader method takes.
ggGlb: a.glb+.metapair, asloadGgGlb(urlwithout extension).loadProps: falseleaves out the props/scenes the meta references,propsPathis where to find them.glb: a plain.glb, asloadModel(urlwithout extension).texture: asloadTexture, with the same options.cubeTexture: asloadCubeTexture(3D only).clip: an audio clip, asloadClip.
Table of contents
utils
AssetRef (type alias)
Names one asset for world.loader.preload and for the assets hook of a level entity class:
the same thing the matching loader method takes.
ggGlb: a.glb+.metapair, asloadGgGlb(urlwithout extension).loadProps: falseleaves out the props/scenes the meta references,propsPathis where to find them.glb: a plain.glb, asloadModel(urlwithout extension).texture: asloadTexture, with the same options.cubeTexture: asloadCubeTexture(3D only).clip: an audio clip, asloadClip.
Signature
export type AssetRef =
| { kind: 'ggGlb'; url: string; loadProps?: boolean; propsPath?: string }
| { kind: 'glb'; url: string; options?: Record<string, any> }
| { kind: 'texture'; url: string; options?: Record<string, any> }
| { kind: 'cubeTexture'; faces: Record<string, string> }
| { kind: 'clip'; url: string }
stableKey
Stable JSON of plain option objects, for cache keys: key order does not matter.
Signature
export declare function stableKey(value: unknown): string