LDKBuiltinComponentType
typedef enum LDKBuiltinComponentType{
LDK_COMPONENT_TYPE_TRANSFORM=UINT32_MAX-1,
LDK_COMPONENT_TYPE_CAMERA=UINT32_MAX-2,
LDK_COMPONENT_TYPE_MESH_SOURCE=UINT32_MAX-3,
LDK_COMPONENT_TYPE_POINT_LIGHT=UINT32_MAX-4,
LDK_COMPONENT_TYPE_SPOT_LIGHT=UINT32_MAX-5,
LDK_COMPONENT_TYPE_DIRECTIONAL_LIGHT=UINT32_MAX-6,
LDK_COMPONENT_TYPE_INSTANCED_MESH_SOURCE=UINT32_MAX-7,
LDK_COMPONENT_TYPE_PARTICLE_EMITTER=UINT32_MAX-8,
LDK_COMPONENT_TYPE_POST_PROCESSING=UINT32_MAX-9,
LDK_COMPONENT_TYPE_TEXT3D=UINT32_MAX-10,
LDK_COMPONENT_TYPE_AUDIO_SOURCE=UINT32_MAX-11,
LDK_COMPONENT_TYPE_GRASS_INTERACT=UINT32_MAX-12,
LDK_COMPONENT_TYPE_TERRAIN_FOLLOWER=UINT32_MAX-14,
LDK_COMPONENT_TYPE_KEYFRAME_ANIMATION_SOURCE=UINT32_MAX-15,
LDK_COMPONENT_TYPE_MATERIAL_INSTANCE=UINT32_MAX-16,
}LDKBuiltinComponentType;
LDKComponentDirectory
A list of all components and component types in an entity.
typedef struct LDKComponentDirectory{
u32 component_type[LDK_ENTITY_MAX_COMPONENTS];
u32 component_index[LDK_ENTITY_MAX_COMPONENTS];
u16 component_flags[LDK_ENTITY_MAX_COMPONENTS];
u16 component_count;
u16 version;
}LDKComponentDirectory;
LDKComponentInstanceFlags
Serialized IDs of engine-owned components. These values are persistent:
once assigned, a retired ID must not be reused for another component.
User component IDs must stay below the engine-reserved high-ID range.
typedef enum LDKComponentInstanceFlags{
LDK_COMPONENT_INSTANCE_FLAG_NONE=0,
LDK_COMPONENT_INSTANCE_FLAG_HIDE_IN_EDITOR=1<<0,
LDK_COMPONENT_INSTANCE_FLAG_DISABLED=1<<1
}LDKComponentInstanceFlags;
LDK_ENTITY_INVALID_COMPONENT_INDEX
#define LDK_ENTITY_INVALID_COMPONENT_INDEX UINT32_MAX
LDK_ENTITY_MAX_COMPONENTS
#define LDK_ENTITY_MAX_COMPONENTS 16
ldk_entity_component_add
Add the entity component.
LDK_API void * ldk_entity_component_add(
LDKEntityRegistry *entity_module,
LDKComponentRegistry *component_module,
LDKEntity entity,
u32 component_type,
const void *initial_value
);
Parameters
LDKEntityRegistry *entity_module
- Entity module used by this operation.
LDKComponentRegistry *component_module
- Component module used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
const void *initial_value
- Initial value used by this operation.
Returns
Pointer to the requested object or data; NULL when unavailable.
ldk_entity_component_count
Count the entity component.
LDK_API u32 ldk_entity_component_count(
LDKEntityRegistry *system,
LDKEntity entity
);
Returns
Number of matching entries.
ldk_entity_component_find
Find the entity component.
LDK_API bool ldk_entity_component_find(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type,
u32 *out_slot,
u32 *out_component_index
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
u32 *out_slot
- Receives the resulting slot.
u32 *out_component_index
- Receives the resulting component index.
Returns
True if the operation succeeds; false otherwise.
ldk_entity_component_flags_add
Add the entity component flags.
LDK_API bool ldk_entity_component_flags_add(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type,
u16 flags
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
u16 flags
- Bitmask of options controlling this operation.
Returns
True if the operation succeeds; false otherwise.
ldk_entity_component_flags_get
Get the entity component flags.
LDK_API u16 ldk_entity_component_flags_get(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
Returns
The requested value.
ldk_entity_component_flags_has
Check whether a component instance has requested flags.
LDK_API bool ldk_entity_component_flags_has(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type,
u16 flags
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
u16 flags
- Bitmask of options controlling this operation.
Returns
True when the queried condition holds; false otherwise.
ldk_entity_component_flags_remove
Remove the entity component flags.
LDK_API bool ldk_entity_component_flags_remove(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type,
u16 flags
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
u16 flags
- Bitmask of options controlling this operation.
Returns
True if the operation succeeds; false otherwise.
ldk_entity_component_flags_set
Set the entity component flags.
LDK_API bool ldk_entity_component_flags_set(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type,
u16 flags
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
u16 flags
- Bitmask of options controlling this operation.
Returns
True if the operation succeeds; false otherwise.
ldk_entity_component_get
Get the entity component.
LDK_API void * ldk_entity_component_get(
LDKEntityRegistry *entity_module,
LDKComponentRegistry *component_module,
LDKEntity entity,
u32 component_type
);
Parameters
LDKEntityRegistry *entity_module
- Entity module used by this operation.
LDKComponentRegistry *component_module
- Component module used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
Returns
Pointer to the requested object or data; NULL when unavailable.
ldk_entity_component_has
Check whether an entity owns a specific component.
LDK_API bool ldk_entity_component_has(
LDKEntityRegistry *system,
LDKEntity entity,
u32 component_type
);
Parameters
LDKEntityRegistry *system
- System used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
Returns
True when the queried condition holds; false otherwise.
ldk_entity_component_remove
Remove the entity component.
LDK_API bool ldk_entity_component_remove(
LDKEntityRegistry *entity_module,
LDKComponentRegistry *component_module,
LDKEntity entity,
u32 component_type
);
Parameters
LDKEntityRegistry *entity_module
- Entity module used by this operation.
LDKComponentRegistry *component_module
- Component module used by this operation.
LDKEntity entity
- Entity to inspect or modify.
u32 component_type
- Registered ECS component type identifier.
Returns
True if the operation succeeds; false otherwise.