LDKInstancedMeshSource
typedef struct LDKInstancedMeshSource{
LDKMeshSource source;
Mat4 *instances;
u32 *instance_colors;
u32 instance_count;
u32 instance_capacity;
}LDKInstancedMeshSource;
An explicitly instanced mesh with entity-local transforms.
typedef struct LDKInstancedMeshSource{
LDKMeshSource source;
Mat4 *instances;
u32 *instance_colors;
u32 instance_count;
u32 instance_capacity;
}LDKInstancedMeshSource;
Ensure capacity for at least count local transforms. Failure preserves the current buffer and instance count. The component owns the buffer.
LDK_API bool ldk_instanced_mesh_source_reserve_instances(
LDKInstancedMeshSource *source,
u32 count
);
LDKInstancedMeshSource *sourceu32 countTrue if the operation succeeds; false otherwise.
Resize the local transform set while retaining allocated capacity. Newly exposed transforms are identity and their colors are opaque white. Failure preserves the set. Systems may write the component buffers before render.
LDK_API bool ldk_instanced_mesh_source_resize_instances(
LDKInstancedMeshSource *source,
u32 count
);
LDKInstancedMeshSource *sourceu32 countTrue if the operation succeeds; false otherwise.
Copy local transforms. Newly exposed colors are opaque white. Zero count clears the active set but retains capacity. Failure preserves it. Use existing mesh-source setters on source for mesh/material authoring.
LDK_API bool ldk_instanced_mesh_source_set_instances(
LDKInstancedMeshSource *source,
const Mat4 *instances,
u32 count
);
LDKInstancedMeshSource *sourceconst Mat4 *instancesu32 countTrue if the operation succeeds; false otherwise.
Copy one RGBA tint per active instance. Colors use 0xRRGGBBAA. The supplied count must match instance_count.
LDK_API bool ldk_instanced_mesh_source_set_instance_colors(
LDKInstancedMeshSource *source,
const u32 *colors,
u32 count
);
LDKInstancedMeshSource *sourceconst u32 *colorsu32 countTrue if the operation succeeds; false otherwise.
Build the ECS registration descriptor for the instanced mesh source component.
LDK_API LDKComponentDesc ldk_instanced_mesh_source_component_desc(u32 initial_capacity);
u32 initial_capacityA descriptor for the requested component or resource.