Kohi Game Engine
|
Go to the source code of this file.
Data Structures | |
struct | xform_system_config |
Typedefs | |
typedef struct xform_system_config | xform_system_config |
Functions | |
b8 | xform_system_initialize (u64 *memory_requirement, void *state, void *config) |
void | xform_system_shutdown (void *state) |
b8 | xform_system_update (void *state, struct frame_data *p_frame_data) |
KAPI khandle | xform_create (void) |
Creates and returns a new xform, using a zero vector for position, identity quaternion for rotation, and a one vector for scale. Also has a null parent. Marked dirty by default. More... | |
KAPI khandle | xform_from_position (vec3 position) |
Creates a xform from the given position. Uses a zero rotation and a one scale. More... | |
KAPI khandle | xform_from_rotation (quat rotation) |
Creates a xform from the given rotation. Uses a zero position and a one scale. More... | |
KAPI khandle | xform_from_position_rotation (vec3 position, quat rotation) |
Creates a xform from the given position and rotation. Uses a one scale. More... | |
KAPI khandle | xform_from_position_rotation_scale (vec3 position, quat rotation, vec3 scale) |
Creates a xform from the given position, rotation and scale. More... | |
KAPI khandle | xform_from_matrix (mat4 m) |
Creates a xform from the provided matrix. More... | |
KAPI void | xform_destroy (khandle *t) |
Destroys the xform with the given handle, and frees the handle. More... | |
KAPI vec3 | xform_position_get (khandle t) |
Returns the position of the given xform. More... | |
KAPI void | xform_position_set (khandle t, vec3 position) |
Sets the position of the given xform. More... | |
KAPI void | xform_translate (khandle t, vec3 translation) |
Applies a translation to the given xform. Not the same as setting. More... | |
KAPI quat | xform_rotation_get (khandle t) |
Returns the rotation of the given xform. More... | |
KAPI void | xform_rotation_set (khandle t, quat rotation) |
Sets the rotation of the given xform. More... | |
KAPI void | xform_rotate (khandle t, quat rotation) |
Applies a rotation to the given xform. Not the same as setting. More... | |
KAPI vec3 | xform_scale_get (khandle t) |
Returns the scale of the given xform. More... | |
KAPI void | xform_scale_set (khandle t, vec3 scale) |
Sets the scale of the given xform. More... | |
KAPI void | xform_scale (khandle t, vec3 scale) |
Applies a scale to the given xform. Not the same as setting. More... | |
KAPI void | xform_position_rotation_set (khandle t, vec3 position, quat rotation) |
Sets the position and rotation of the given xform. More... | |
KAPI void | xform_position_rotation_scale_set (khandle t, vec3 position, quat rotation, vec3 scale) |
Sets the position, rotation and scale of the given xform. More... | |
KAPI void | xform_translate_rotate (khandle t, vec3 translation, quat rotation) |
Applies translation and rotation to the given xform. More... | |
KAPI void | xform_calculate_local (khandle t) |
KAPI mat4 | xform_local_get (khandle t) |
Retrieves the local xformation matrix from the provided xform. Automatically recalculates the matrix if it is dirty. Otherwise, the already calculated one is returned. More... | |
KAPI void | xform_world_set (khandle t, mat4 world) |
KAPI mat4 | xform_world_get (khandle t) |
Obtains the world matrix of the given xform. More... | |
KAPI const char * | xform_to_string (khandle t) |
Returns a string representation of the xform pointed to by the given handle. More... | |
KAPI b8 | xform_from_string (const char *str, khandle *out_xform) |
Creates an xform from the given string. More... | |
typedef struct xform_system_config xform_system_config |
Recalculates the local matrix for the transform with the given handle.
Creates and returns a new xform, using a zero vector for position, identity quaternion for rotation, and a one vector for scale. Also has a null parent. Marked dirty by default.
Destroys the xform with the given handle, and frees the handle.
t | A pointer to a handle to the transform to be destroyed. The handle itself is also invalidated. |
Creates a xform from the provided matrix.
m | The matrix to decompose and extract a transform from. |
Creates a xform from the given position. Uses a zero rotation and a one scale.
position | The position to be used. |
Creates a xform from the given position and rotation. Uses a one scale.
position | The position to be used. |
rotation | The rotation to be used. |
Creates a xform from the given position, rotation and scale.
position | The position to be used. |
rotation | The rotation to be used. |
scale | The scale to be used. |
Creates a xform from the given rotation. Uses a zero position and a one scale.
rotation | The rotation to be used. |
Creates an xform from the given string.
str | The string from which to create the xform. Should be either 'x y z qx qy qz qw sx sy sz' (quaternion rotation) OR 'x y z ex ey ez sx sy sz' (euler rotation) |
out_xform | A pointer to hold the handle to the newly created xform. |
Retrieves the local xformation matrix from the provided xform. Automatically recalculates the matrix if it is dirty. Otherwise, the already calculated one is returned.
t | A handle to the xform whose matrix to retrieve. |
Returns the position of the given xform.
t | A handle whose position to get. |
Sets the position, rotation and scale of the given xform.
t | A handle to the xform to be updated. |
position | The position to be set. |
rotation | The rotation to be set. |
scale | The scale to be set. |
Sets the position and rotation of the given xform.
t | A handle to the xform to be updated. |
position | The position to be set. |
rotation | The rotation to be set. |
Sets the position of the given xform.
t | A handle to the xform to be updated. |
position | The position to be set. |
Applies a rotation to the given xform. Not the same as setting.
t | A handle to the xform to be updated. |
rotation | The rotation to be applied. |
Returns the rotation of the given xform.
t | A handle whose rotation to get. |
Sets the rotation of the given xform.
t | A handle to the xform to be updated. |
rotation | The rotation to be set. |
Applies a scale to the given xform. Not the same as setting.
t | A handle to the xform to be updated. |
scale | The scale to be applied. |
Returns the scale of the given xform.
t | A handle whose scale to get. |
Sets the scale of the given xform.
t | A handle to the xform to be updated. |
scale | The scale to be set. |
void xform_system_shutdown | ( | void * | state | ) |
b8 xform_system_update | ( | void * | state, |
struct frame_data * | p_frame_data | ||
) |
Returns a string representation of the xform pointed to by the given handle.
t | A handle to the xform to retrieve as a string. |
Applies a translation to the given xform. Not the same as setting.
t | A handle to the xform to be updated. |
translation | The translation to be applied. |
Applies translation and rotation to the given xform.
t | A handle to the xform to be updated. |
translation | The translation to be applied. |
rotation | The rotation to be applied. |
Obtains the world matrix of the given xform.
t | A handle to the xform whose world matrix to retrieve. |