Class: LazyMeshPrimitive
Experimental
A MeshPrimitive whose code loads on first use: the same data, updates, transform, light rig and picking once loaded. Until then it keeps the latest of each and draws nothing (its object is a hidden placeholder the mesh draws into later, so callers can hold it and set its renderOrder at any time). A failed load resolves ready (the mesh stays undrawn) and is retried by the next update.
Implements
Constructors
Constructor
new LazyMeshPrimitive(context, data): LazyMeshPrimitive;Experimental
Parameters
| Parameter | Type |
|---|---|
context | PrimitiveContext |
data | MeshInput |
Returns
LazyMeshPrimitive
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
object | readonly | Mesh | Experimental Root object to add to a viewport's scene. |
Accessors
mesh
Get Signature
get mesh(): MeshPrimitive | null;Experimental
The underlying mesh primitive, once loaded (else null).
Returns
MeshPrimitive | null
pickCount
Get Signature
get pickCount(): number;Experimental
Number of ids the pick material may write (e.g. drawn instances).
Returns
number
Experimental
Number of ids the pick material may write (e.g. drawn instances).
Implementation of
pickKind
Get Signature
get pickKind(): "vertex" | "triangle";Experimental
What a pick id offset counts (e.g. 'point' for markers).
Returns
"vertex" | "triangle"
Experimental
What a pick id offset counts (e.g. 'point' for markers).
Implementation of
ready
Get Signature
get ready(): Promise<void>;Experimental
Resolves once the mesh code has loaded (or failed to) and the mesh holds the data.
Returns
Promise<void>
Methods
createPickMaterial()
createPickMaterial(): PickMaterialHandle;Experimental
Only called by the picker once the mesh is drawn (the placeholder is hidden until then).
Returns
Implementation of
PickablePrimitive.createPickMaterial
dispose()
dispose(): void;Experimental
Release GPU resources. The primitive must not be used afterwards.
Returns
void
Implementation of
setLightRig()
setLightRig(rig): void;Experimental
See MeshPrimitive.setLightRig.
Parameters
| Parameter | Type |
|---|---|
rig | LightRig | null |
Returns
void
setTransform()
setTransform(transform): void;Experimental
Set the data → world transform (cheap: uniforms only, no buffer uploads).
Parameters
| Parameter | Type |
|---|---|
transform | DataTransform |
Returns
void
Implementation of
setViewport()
setViewport(size): void;Experimental
Update viewport-dependent uniforms (resolution, pixel ratio).
Parameters
| Parameter | Type |
|---|---|
size | ViewportSize |
Returns
void
Implementation of
update()
update(patch): void;Experimental
Replace or patch the primitive's data. Omitted fields keep their previous values.
Parameters
| Parameter | Type |
|---|---|
patch | Partial<MeshData> |
Returns
void