townengine/include/twn_camera.h

23 lines
597 B
C

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_types.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 {
Vec3 pos; /* eye position */
Vec3 target; /* normalized target vector */
Vec3 up; /* normalized up vector */
float fov; /* field of view, in radians */
} Camera;
TWN_API Matrix4 camera_look_at(const Camera *camera);
TWN_API Matrix4 camera_perspective(const Camera *const camera);
#endif