townengine/townengine/camera.h

22 lines
558 B
C
Raw Normal View History

#ifndef CAMERA_H
#define CAMERA_H
#include "util.h"
2024-07-30 15:05:05 +00:00
/* TODO: make it cached */
/* for example, perspective matrix only needs recaluclation on FOV change */
/* first person camera class */
typedef struct camera {
2024-07-30 15:05:05 +00:00
t_fvec3 pos; /* eye position */
t_fvec3 target; /* normalized target vector */
t_fvec3 up; /* normalized up vector */
2024-07-30 21:18:01 +00:00
float fov; /* field of view, in radians */
} t_camera;
t_matrix4 camera_look_at(const t_camera *camera);
2024-07-30 15:05:05 +00:00
t_matrix4 camera_perspective(const t_camera *const camera);
#endif