townengine/src/twn_camera_c.h

22 lines
550 B
C
Raw Normal View History

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_types.h"
/* TODO: make it cached? */
2024-07-30 15:05:05 +00:00
/* for example, perspective matrix only needs recaluclation on FOV change */
/* first person camera class */
typedef struct Camera {
Vec3 pos; /* eye position */
Vec3 target; /* normalized target vector */
Vec3 up; /* normalized up vector */
2024-10-28 09:34:48 +00:00
float fov; /* field of view, in radians */
} Camera;
2024-10-28 09:34:48 +00:00
Matrix4 camera_look_at(const Camera *camera);
2024-10-28 09:34:48 +00:00
Matrix4 camera_perspective(const Camera *const camera);
2024-07-30 15:05:05 +00:00
#endif