|
Kohi Game Engine
|
#include "math/math_types.h"Go to the source code of this file.
Data Structures | |
| struct | camera |
| Represents a camera that can be used for a variety of things, especially rendering. Ideally, these are created and managed by the camera system. More... | |
Typedefs | |
| typedef struct camera | camera |
| Represents a camera that can be used for a variety of things, especially rendering. Ideally, these are created and managed by the camera system. More... | |
Functions | |
| KAPI camera | camera_create (void) |
| Creates a new camera with default zero position and rotation, and view identity matrix. Ideally, the camera system should be used to create this instead of doing so directly. More... | |
| KAPI camera | camera_copy (camera source) |
| Creates a copy of the camera based on the provided source. More... | |
| KAPI void | camera_reset (camera *c) |
| Defaults the provided camera to default zero rotation and position, and view matrix to identity. More... | |
| KAPI vec3 | camera_position_get (const camera *c) |
| Gets a copy of the camera's position. More... | |
| KAPI void | camera_position_set (camera *c, vec3 position) |
| Sets the provided camera's position. More... | |
| KAPI vec3 | camera_rotation_euler_get (const camera *c) |
| Gets a copy of the camera's rotation in Euler angles. More... | |
| KAPI void | camera_rotation_euler_set (camera *c, vec3 rotation) |
| Sets the provided camera's rotation in Euler angles (degrees). More... | |
| KAPI void | camera_rotation_euler_set_radians (camera *c, vec3 rotation_radians) |
| Sets the provided camera's rotation in Euler angles (radians). More... | |
| KAPI mat4 | camera_view_get (camera *c) |
| Obtains a copy of the camera's view matrix. If camera is dirty, a new one is created, set and returned. More... | |
| KAPI mat4 | camera_inverse_view_get (camera *c) |
| KAPI vec3 | camera_forward (camera *c) |
| Returns a copy of the camera's forward vector. More... | |
| KAPI vec3 | camera_backward (camera *c) |
| Returns a copy of the camera's backward vector. More... | |
| KAPI vec3 | camera_left (camera *c) |
| Returns a copy of the camera's left vector. More... | |
| KAPI vec3 | camera_right (camera *c) |
| Returns a copy of the camera's right vector. More... | |
| KAPI vec3 | camera_up (camera *c) |
| Returns a copy of the camera's up vector. More... | |
| KAPI void | camera_move_forward (camera *c, f32 amount) |
| Moves the camera forward by the given amount. More... | |
| KAPI void | camera_move_backward (camera *c, f32 amount) |
| Moves the camera backward by the given amount. More... | |
| KAPI void | camera_move_left (camera *c, f32 amount) |
| Moves the camera left by the given amount. More... | |
| KAPI void | camera_move_right (camera *c, f32 amount) |
| Moves the camera right by the given amount. More... | |
| KAPI void | camera_move_up (camera *c, f32 amount) |
| Moves the camera up (straight along the y-axis) by the given amount. More... | |
| KAPI void | camera_move_down (camera *c, f32 amount) |
| Moves the camera down (straight along the y-axis) by the given amount. More... | |
| KAPI void | camera_yaw (camera *c, f32 amount) |
| Adjusts the camera's yaw by the given amount. More... | |
| KAPI void | camera_pitch (camera *c, f32 amount) |
| Adjusts the camera's pitch by the given amount. More... | |
Represents a camera that can be used for a variety of things, especially rendering. Ideally, these are created and managed by the camera system.
Returns a copy of the camera's backward vector.
| c | A pointer to a camera. |
Creates a copy of the camera based on the provided source.
| source | A constant pointer to a camera source. |
Creates a new camera with default zero position and rotation, and view identity matrix. Ideally, the camera system should be used to create this instead of doing so directly.
Returns a copy of the camera's forward vector.
| c | A pointer to a camera. |
Returns a copy of the camera's left vector.
| c | A pointer to a camera. |
Moves the camera backward by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Moves the camera down (straight along the y-axis) by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Moves the camera forward by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Moves the camera left by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Moves the camera right by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Moves the camera up (straight along the y-axis) by the given amount.
| c | A pointer to a camera. |
| amount | The amount to move. |
Adjusts the camera's pitch by the given amount.
| c | A pointer to a camera. |
| amount | The amount to adjust by. |
Gets a copy of the camera's position.
| c | A constant pointer to a camera. |
Sets the provided camera's position.
| c | A pointer to a camera. |
| position | The position to be set. |
Defaults the provided camera to default zero rotation and position, and view matrix to identity.
| c | A pointer to the camera to be reset. |
Returns a copy of the camera's right vector.
| c | A pointer to a camera. |
Gets a copy of the camera's rotation in Euler angles.
| c | A constant pointer to a camera. |
Sets the provided camera's rotation in Euler angles (degrees).
| c | A pointer to a camera. |
| rotation | The rotation in Euler angles to be set (degrees). |
Sets the provided camera's rotation in Euler angles (radians).
| c | A pointer to a camera. |
| rotation_radians | The rotation in Euler angles to be set (radians). |
Returns a copy of the camera's up vector.
| c | A pointer to a camera. |
Obtains a copy of the camera's view matrix. If camera is dirty, a new one is created, set and returned.
| c | A pointer to a camera. |