blob: add3684089871940ba3689887bea9410e6805faf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef _SOFTSHADEROOM_CAMERA_H_
#define _SOFTSHADEROOM_CAMERA_H_
#include "../math/math.h"
#include "../extern/wog.h"
#include "transform.h"
#undef near
#undef far
typedef struct Camera Camera;
typedef struct {
Vec3 position;
Euler euler;
float fov, aspect, near, far;
Vec2 rotate_sensitivity, move_sensitivity;
float zoom_speed;
}CameraConfig;
Camera* camera_create(wog_Window* wnd, CameraConfig* config);
void camera_destroy(Camera* cam);
void camera_setposition(float x, float y, float z);
void camera_onevent(Camera* cam, wog_Event* e, float dt);
void camera_onupdate(Camera* cam, float dt);
void camera_getmatrix(Mat4* view, Mat4* proj);
void camera_getviewmatrix(Camera* cam, Mat4* view);
void camera_getprojmatrix(Camera* cam, Mat4* proj);
void camera_ondraw(Camera* cam);
#endif
|