townengine/include/twn_camera.h

23 lines
615 B
C

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_util.h"
#include "twn_engine_api.h"
/* TODO: make it cached? */
/* for example, perspective matrix only needs recaluclation on FOV change */
/* first person camera class */
typedef struct camera {
t_fvec3 pos; /* eye position */
t_fvec3 target; /* normalized target vector */
t_fvec3 up; /* normalized up vector */
float fov; /* field of view, in radians */
} t_camera;
TWN_API t_matrix4 camera_look_at(const t_camera *camera);
TWN_API t_matrix4 camera_perspective(const t_camera *const camera);
#endif