townengine/src/twn_camera_c.h
2025-01-10 02:40:52 +03:00

23 lines
575 B
C

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_types.h"
#include "twn_types_c.h"
/* TODO: make it cached? */
/* 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 */
float fov; /* field of view, in radians */
} Camera;
Matrix4 camera_look_at(const Camera *camera);
Matrix4 camera_perspective(const Camera *const camera);
#endif