Kohi Game Engine
|
#include "math_types.h"
Go to the source code of this file.
Functions | |
KAPI transform | transform_create (void) |
Creates and returns a new transform, 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 transform | transform_from_position (vec3 position) |
Creates a transform from the given position. Uses a zero rotation and a one scale. More... | |
KAPI transform | transform_from_rotation (quat rotation) |
Creates a transform from the given rotation. Uses a zero position and a one scale. More... | |
KAPI transform | transform_from_position_rotation (vec3 position, quat rotation) |
Creates a transform from the given position and rotation. Uses a one scale. More... | |
KAPI transform | transform_from_position_rotation_scale (vec3 position, quat rotation, vec3 scale) |
Creates a transform from the given position, rotation and scale. More... | |
KAPI transform * | transform_parent_get (transform *t) |
Returns a pointer to the provided transform's parent. More... | |
KAPI void | transform_parent_set (transform *t, transform *parent) |
Sets the parent of the provided transform. More... | |
KAPI vec3 | transform_position_get (const transform *t) |
Returns the position of the given transform. More... | |
KAPI void | transform_position_set (transform *t, vec3 position) |
Sets the position of the given transform. More... | |
KAPI void | transform_translate (transform *t, vec3 translation) |
Applies a translation to the given transform. Not the same as setting. More... | |
KAPI quat | transform_rotation_get (const transform *t) |
Returns the rotation of the given transform. More... | |
KAPI void | transform_rotation_set (transform *t, quat rotation) |
Sets the rotation of the given transform. More... | |
KAPI void | transform_rotate (transform *t, quat rotation) |
Applies a rotation to the given transform. Not the same as setting. More... | |
KAPI vec3 | transform_scale_get (const transform *t) |
Returns the scale of the given transform. More... | |
KAPI void | transform_scale_set (transform *t, vec3 scale) |
Sets the scale of the given transform. More... | |
KAPI void | transform_scale (transform *t, vec3 scale) |
Applies a scale to the given transform. Not the same as setting. More... | |
KAPI void | transform_position_rotation_set (transform *t, vec3 position, quat rotation) |
Sets the position and rotation of the given transform. More... | |
KAPI void | transform_position_rotation_scale_set (transform *t, vec3 position, quat rotation, vec3 scale) |
Sets the position, rotation and scale of the given transform. More... | |
KAPI void | transform_translate_rotate (transform *t, vec3 translation, quat rotation) |
Applies translation and rotation to the given transform. More... | |
KAPI mat4 | transform_local_get (transform *t) |
Retrieves the local transformation matrix from the provided transform. Automatically recalculates the matrix if it is dirty. Otherwise, the already calculated one is returned. More... | |
KAPI mat4 | transform_world_get (transform *t) |
Obtains the world matrix of the given transform by examining its parent (if there is one) and multiplying it against the local matrix. More... | |
Creates and returns a new transform, 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.
Creates a transform from the given position. Uses a zero rotation and a one scale.
position | The position to be used. |
Creates a transform from the given position and rotation. Uses a one scale.
position | The position to be used. |
rotation | The rotation to be used. |
Creates a transform 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 transform from the given rotation. Uses a zero position and a one scale.
rotation | The rotation to be used. |
Retrieves the local transformation matrix from the provided transform. Automatically recalculates the matrix if it is dirty. Otherwise, the already calculated one is returned.
t | A pointer to the transform whose matrix to retrieve. |
Returns a pointer to the provided transform's parent.
t | A pointer to the transform whose parent to retrieve. |
Sets the parent of the provided transform.
t | A pointer to the transform whose parent will be set. |
parent | A pointer to the parent transform. |
Returns the position of the given transform.
t | A constant pointer whose position to get. |
KAPI void transform_position_rotation_scale_set | ( | transform * | t, |
vec3 | position, | ||
quat | rotation, | ||
vec3 | scale | ||
) |
Sets the position, rotation and scale of the given transform.
t | A pointer to the transform 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 transform.
t | A pointer to the transform to be updated. |
position | The position to be set. |
rotation | The rotation to be set. |
Sets the position of the given transform.
t | A pointer to the transform to be updated. |
position | The position to be set. |
Applies a rotation to the given transform. Not the same as setting.
t | A pointer to the transform to be updated. |
rotation | The rotation to be applied. |
Returns the rotation of the given transform.
t | A constant pointer whose rotation to get. |
Sets the rotation of the given transform.
t | A pointer to the transform to be updated. |
rotation | The rotation to be set. |
Applies a scale to the given transform. Not the same as setting.
t | A pointer to the transform to be updated. |
scale | The scale to be applied. |
Returns the scale of the given transform.
t | A constant pointer whose scale to get. |
Sets the scale of the given transform.
t | A pointer to the transform to be updated. |
scale | The scale to be set. |
Applies a translation to the given transform. Not the same as setting.
t | A pointer to the transform to be updated. |
translation | The translation to be applied. |
Applies translation and rotation to the given transform.
t | A pointer to the transform to be updated. |
translation | The translation to be applied. |
rotation | The rotation to be applied. |