townengine/src/twn_camera_c.h

23 lines
575 B
C
Raw Normal View History

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_types.h"
2025-01-09 23:40:52 +00:00
#include "twn_types_c.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