townengine/include/twn_camera.h

23 lines
597 B
C
Raw Normal View History

#ifndef TWN_CAMERA_H
#define TWN_CAMERA_H
#include "twn_types.h"
#include "twn_engine_api.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-07-30 21:18:01 +00:00
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);
2024-07-30 15:05:05 +00:00
#endif