LDKTransformFlags
typedef enum LDKTransformFlags{
LDK_TRANSFORM_FLAG_NONE=0,
LDK_TRANSFORM_FLAG_WORLD_DIRTY=1<<0,
}LDKTransformFlags;
LDK Transform Component
Coordinate System Conventions:
typedef enum LDKTransformFlags{
LDK_TRANSFORM_FLAG_NONE=0,
LDK_TRANSFORM_FLAG_WORLD_DIRTY=1<<0,
}LDKTransformFlags;
typedef struct LDKTransform{
u32 flags;
Vec3 local_position;
Vec3 local_scale;
Quat local_rotation;
Mat4 world_matrix;
LDKEntity parent;
LDKEntity first_child;
LDKEntity next_sibling;
LDKEntity prev_sibling;
}LDKTransform;
Create default settings for transform.
LDK_API LDKTransform ldk_transform_make_default(void);
A value initialized with the engine defaults.
Set transform local position.
LDK_API bool ldk_transform_set_local_position(
LDKEntity entity,
Vec3 position
);
LDKEntity entityVec3 positionTrue if the operation succeeds; false otherwise.
Set transform local rotation.
LDK_API bool ldk_transform_set_local_rotation(
LDKEntity entity,
Quat rotation
);
LDKEntity entityQuat rotationTrue if the operation succeeds; false otherwise.
Set transform local scale.
LDK_API bool ldk_transform_set_local_scale(
LDKEntity entity,
Vec3 scale
);
LDKEntity entityVec3 scaleTrue if the operation succeeds; false otherwise.
Get transform local position.
LDK_API bool ldk_transform_get_local_position(
LDKEntity entity,
Vec3 *out_position
);
LDKEntity entityVec3 *out_positionTrue if the operation succeeds; false otherwise.
Get transform local rotation.
LDK_API bool ldk_transform_get_local_rotation(
LDKEntity entity,
Quat *out_rotation
);
LDKEntity entityQuat *out_rotationTrue if the operation succeeds; false otherwise.
Get transform local scale.
LDK_API bool ldk_transform_get_local_scale(
LDKEntity entity,
Vec3 *out_scale
);
LDKEntity entityVec3 *out_scaleTrue if the operation succeeds; false otherwise.
Get transform world matrix.
LDK_API bool ldk_transform_get_world_matrix(
LDKEntity entity,
Mat4 *out_world_matrix
);
LDKEntity entityMat4 *out_world_matrixTrue if the operation succeeds; false otherwise.
Set transform parent.
LDK_API bool ldk_transform_set_parent(
LDKEntity child_entity,
LDKEntity parent_entity
);
True if the operation succeeds; false otherwise.
Get transform parent.
LDK_API LDKEntity ldk_transform_get_parent(LDKEntity entity);
LDKEntity entityThe requested value.
Mark an entity transform dirty so its world state can be recalculated.
LDK_API bool ldk_transform_mark_dirty(LDKEntity entity);
LDKEntity entityTrue if the operation succeeds; false otherwise.
Build the ECS registration descriptor for the transform component.
LDK_API LDKComponentDesc ldk_transform_component_desc(u32 initial_capacity);
u32 initial_capacityA descriptor for the requested component or resource.