Kohi Game Engine
transform.h
Go to the documentation of this file.
1 #include "math_types.h"
2 
10 
19 
28 
38 
48 
56 
64 
72 
80 
88 KAPI void transform_translate(transform* t, vec3 translation);
89 
97 
105 
113 KAPI void transform_rotate(transform* t, quat rotation);
114 
122 
130 
139 
148 
157 KAPI void transform_position_rotation_scale_set(transform* t, vec3 position, quat rotation, vec3 scale);
158 
167 KAPI void transform_translate_rotate(transform* t, vec3 translation, quat rotation);
168 
178 
#define KAPI
Import/export qualifier.
Definition: defines.h:177
Contains various math types required for the engine.
Represents the transform of an object in the world. Transforms can have a parent whose own transform ...
Definition: math_types.h:215
KAPI vec3 transform_scale_get(const transform *t)
Returns the scale of the given transform.
KAPI void transform_scale_set(transform *t, vec3 scale)
Sets the scale of the given transform.
KAPI void transform_position_set(transform *t, vec3 position)
Sets the position of the given transform.
KAPI transform transform_from_position_rotation_scale(vec3 position, quat rotation, vec3 scale)
Creates a transform from the given position, rotation and scale.
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.
KAPI void transform_scale(transform *t, vec3 scale)
Applies a scale to the given transform. Not the same as setting.
KAPI transform transform_from_position(vec3 position)
Creates a transform from the given position. Uses a zero rotation and a one scale.
KAPI void transform_position_rotation_set(transform *t, vec3 position, quat rotation)
Sets the position and rotation of the given transform.
KAPI mat4 transform_local_get(transform *t)
Retrieves the local transformation matrix from the provided transform. Automatically recalculates the...
KAPI void transform_translate_rotate(transform *t, vec3 translation, quat rotation)
Applies translation and rotation to the given transform.
KAPI void transform_parent_set(transform *t, transform *parent)
Sets the parent of the provided transform.
KAPI void transform_rotate(transform *t, quat rotation)
Applies a rotation to the given transform. Not the same as setting.
KAPI transform transform_from_position_rotation(vec3 position, quat rotation)
Creates a transform from the given position and rotation. Uses a one scale.
KAPI transform transform_from_rotation(quat rotation)
Creates a transform from the given rotation. Uses a zero position and a one scale.
KAPI vec3 transform_position_get(const transform *t)
Returns the position of the given transform.
KAPI transform * transform_parent_get(transform *t)
Returns a pointer to the provided transform's parent.
KAPI void transform_translate(transform *t, vec3 translation)
Applies a translation to the given transform. Not the same as setting.
KAPI mat4 transform_world_get(transform *t)
Obtains the world matrix of the given transform by examining its parent (if there is one) and multipl...
KAPI quat transform_rotation_get(const transform *t)
Returns the rotation of the given transform.
KAPI void transform_rotation_set(transform *t, quat rotation)
Sets the rotation of the given transform.
KAPI transform transform_create(void)
Creates and returns a new transform, using a zero vector for position, identity quaternion for rotati...
a 4x4 matrix, typically used to represent object transformations.
Definition: math_types.h:147
A 3-element vector.
Definition: math_types.h:49
A 4-element vector.
Definition: math_types.h:89