summaryrefslogtreecommitdiff
path: root/camera.h
blob: b760f7f4f9172ca6af4dbfd2e7690fa3d517fe11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef camera_h
#define camera_h

#include "prbm.h"

struct camera {
    v3 pos;
    v3 angles;
    f32 fov;
    f32 near;
    f32 far;
};

struct camera create_default_camera(void);
mat get_camera_view_mat(struct camera cam);
void get_camera_vectors(struct camera camera, v3 *l, v3 *u, v3 *f);
mat camera_lookat(struct camera camera, v3 target, v3 world_up);
mat ortho(f32 l, f32 r, f32 b, f32 t, f32 n, f32 f);
mat perspective(f32 near, f32 far, f32 fov, f32 aspect_ratio);
mat camera_perspective(struct camera camera, f32 aspect_ratio);

#endif