$darkmode
#include "camera.h"#include <cglm/cam.h>#include <cglm/types.h>#include <cglm/util.h>#include <cglm/vec3.h>#include <math.h>Functions | |
| void | camera_init (Camera *cam, float distance, float yaw, float pitch) |
| Initializes the camera with default values. More... | |
| void | camera_update_vectors (Camera *cam) |
| Recalculates front, right, and up vectors from yaw and pitch. More... | |
| void | camera_fixed_update (Camera *cam) |
| Performs one fixed-step physics update. More... | |
| void | camera_process_mouse (Camera *cam, float xoffset, float yoffset) |
| Processes mouse movement to update target orientation. More... | |
| void | camera_get_view_matrix (Camera *cam, mat4 view) |
| Generates the 4x4 view matrix for this camera. More... | |
| void | camera_process_scroll (Camera *cam, float yoffset) |
| Processes mouse scroll events to apply physical impulse. More... | |
| void camera_fixed_update | ( | Camera * | cam | ) |
Performs one fixed-step physics update.
Handles momentum, friction, and head-bobbing calculations.
| cam | Pointer to the camera instance. |
| void camera_get_view_matrix | ( | Camera * | cam, |
| mat4 | view | ||
| ) |
Generates the 4x4 view matrix for this camera.
| cam | Pointer to the camera instance. | |
| [out] | view | Matrix to populate. |
| void camera_init | ( | Camera * | cam, |
| float | distance, | ||
| float | yaw, | ||
| float | pitch | ||
| ) |
Initializes the camera with default values.
| cam | Pointer to the camera instance. |
| distance | Initial forward offset (legacy). |
| yaw | Initial horizontal rotation. |
| pitch | Initial vertical rotation. |
| void camera_process_mouse | ( | Camera * | cam, |
| float | xoffset, | ||
| float | yoffset | ||
| ) |
Processes mouse movement to update target orientation.
| cam | Pointer to the camera instance. |
| xoffset | Relative horizontal mouse movement. |
| yoffset | Relative vertical mouse movement. |
| void camera_process_scroll | ( | Camera * | cam, |
| float | yoffset | ||
| ) |
Processes mouse scroll events to apply physical impulse.
| cam | Pointer to the camera instance. |
| yoffset | Scroll amount along the y-axis. |
| void camera_update_vectors | ( | Camera * | cam | ) |
Recalculates front, right, and up vectors from yaw and pitch.
| cam | Pointer to the camera instance. |