33 lines
503 B
C
33 lines
503 B
C
|
#ifndef CAMERA_H
|
||
|
#define CAMERA_H
|
||
|
|
||
|
#include <cglm/vec3.h>
|
||
|
#include <cglm/mat4.h>
|
||
|
|
||
|
#define CAMERA_PERSPECTIVE 0x1
|
||
|
#define CAMERA_ORTHOGONAL 0x2
|
||
|
|
||
|
struct camera {
|
||
|
int type;
|
||
|
float fov;
|
||
|
float near_z;
|
||
|
float far_z;
|
||
|
float yaw;
|
||
|
float pitch;
|
||
|
float sensitivity;
|
||
|
float viewport_modifier;
|
||
|
|
||
|
vec3 pos;
|
||
|
vec3 front;
|
||
|
vec3 center;
|
||
|
vec3 up;
|
||
|
|
||
|
mat4 view;
|
||
|
mat4 projection;
|
||
|
};
|
||
|
|
||
|
struct camera *create_camera(int type);
|
||
|
int bake_camera(struct camera *c);
|
||
|
|
||
|
#endif
|