LDKMeshSourceMaterialBinding
typedef struct LDKMeshSourceMaterialBinding{
LDKMaterialDesc material;
LDKAssetMaterial material_asset;
u64 material_revision;
LDKResourceMaterial renderer_material;
LDKResourceTexture renderer_texture;
LDKResourceTexture renderer_normal_map;
LDKResourceTexture renderer_specular_map;
bool material_dirty;
}LDKMeshSourceMaterialBinding;
LDKMeshSource
typedef struct LDKMeshSource{
LDKAssetMesh source_asset;
u32 mesh_index;
bool casts_shadows;
bool billboard;
LDKMaterialDesc material;
LDKAssetMaterial material_asset;
u64 material_revision;
LDKResourceMesh renderer_mesh;
LDKResourceMaterial renderer_material;
LDKResourceTexture renderer_texture;
LDKResourceTexture renderer_normal_map;
LDKResourceTexture renderer_specular_map;
struct LDKRenderer *renderer;
bool dirty;
bool material_dirty;
LDKMeshSourceMaterialBinding *additional_materials;
u32 material_count;
}LDKMeshSource;
ldk_mesh_source_set_data
Set mesh source data.
LDK_API bool ldk_mesh_source_set_data(
LDKMeshSource *mesh_source,
LDKAssetMesh asset
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
LDKAssetMesh asset
- Asset handle to inspect or modify.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_set_mesh_index
Set mesh source mesh index.
LDK_API bool ldk_mesh_source_set_mesh_index(
LDKMeshSource *mesh_source,
LDKAssetManager *assets,
u32 mesh_index
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
LDKAssetManager *assets
- Asset manager used to resolve referenced assets.
u32 mesh_index
- Zero-based index of the mesh entry.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_materials_sync
Synchronize the mesh source materials.
LDK_API bool ldk_mesh_source_materials_sync(
LDKMeshSource *mesh_source,
LDKAssetManager *assets
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
LDKAssetManager *assets
- Asset manager used to resolve referenced assets.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_material_count
Get the number of material slots in a mesh source.
LDK_API u32 ldk_mesh_source_material_count(const LDKMeshSource *mesh_source);
Parameters
const LDKMeshSource *mesh_source
- Mesh source used by this operation.
Returns
Number of matching entries.
ldk_mesh_source_additional_material_binding
Get a mutable material binding for an additional mesh slot.
LDK_API LDKMeshSourceMaterialBinding * ldk_mesh_source_additional_material_binding(
LDKMeshSource *mesh_source,
u32 material_slot
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
u32 material_slot
- Material slot used by this operation.
Returns
Pointer to the requested object or data; NULL when unavailable.
ldk_mesh_source_additional_material_binding_const
Get a read-only material binding for an additional mesh slot.
LDK_API const LDKMeshSourceMaterialBinding * ldk_mesh_source_additional_material_binding_const(
const LDKMeshSource *mesh_source,
u32 material_slot
);
Parameters
const LDKMeshSource *mesh_source
- Mesh source used by this operation.
u32 material_slot
- Material slot used by this operation.
Returns
Pointer to the requested object or data; NULL when unavailable.
ldk_mesh_source_set_material
Set mesh source material.
LDK_API bool ldk_mesh_source_set_material(
LDKMeshSource *mesh_source,
LDKMaterialDesc const *material
);
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_set_material_at
Assign a material descriptor to the specified mesh material slot.
LDK_API bool ldk_mesh_source_set_material_at(
LDKMeshSource *mesh_source,
u32 material_slot,
LDKMaterialDesc const *material
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
u32 material_slot
- Material slot used by this operation.
LDKMaterialDesc const *material
- Material used by the operation.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_set_material_asset
Set mesh source material asset.
LDK_API bool ldk_mesh_source_set_material_asset(
LDKMeshSource *mesh_source,
LDKAssetManager *assets,
LDKAssetMaterial asset
);
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_set_material_asset_at
Assign a material asset to the specified mesh material slot.
LDK_API bool ldk_mesh_source_set_material_asset_at(
LDKMeshSource *mesh_source,
LDKAssetManager *assets,
u32 material_slot,
LDKAssetMaterial asset
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
LDKAssetManager *assets
- Asset manager used to resolve referenced assets.
u32 material_slot
- Material slot used by this operation.
LDKAssetMaterial asset
- Asset handle to inspect or modify.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_material_sync
Synchronize the mesh source material.
LDK_API bool ldk_mesh_source_material_sync(
LDKMeshSource *mesh_source,
LDKAssetManager *assets
);
Parameters
LDKMeshSource *mesh_source
- Mesh source used by this operation.
LDKAssetManager *assets
- Asset manager used to resolve referenced assets.
Returns
True if the operation succeeds; false otherwise.
ldk_mesh_source_component_desc
Build the ECS registration descriptor for the mesh source component.
LDK_API LDKComponentDesc ldk_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.