LDKInstancedMeshSource

typedef struct LDKInstancedMeshSource{
  LDKMeshSource source;
  Mat4 *instances;
  u32 *instance_colors;
  u32 instance_count;
  u32 instance_capacity;
}LDKInstancedMeshSource;

ldk_instanced_mesh_source_reserve_instances

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
);

Parameters

LDKInstancedMeshSource *source
Source object or source data for this operation.
u32 count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

ldk_instanced_mesh_source_resize_instances

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
);

Parameters

LDKInstancedMeshSource *source
Source object or source data for this operation.
u32 count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

ldk_instanced_mesh_source_set_instances

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
);

Parameters

LDKInstancedMeshSource *source
Source object or source data for this operation.
const Mat4 *instances
Instances used by this operation.
u32 count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

ldk_instanced_mesh_source_set_instance_colors

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
);

Parameters

LDKInstancedMeshSource *source
Source object or source data for this operation.
const u32 *colors
Colors used by this operation.
u32 count
Number of items to process.

Returns

True if the operation succeeds; false otherwise.

ldk_instanced_mesh_source_component_desc

Build the ECS registration descriptor for the instanced mesh source component.

LDK_API LDKComponentDesc ldk_instanced_mesh_source_component_desc(u32 initial_capacity);

Parameters

u32 initial_capacity
Initial number of entries reserved in the registry.

Returns

A descriptor for the requested component or resource.