diff options
author | chai <chaifix@163.com> | 2020-02-24 10:28:41 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-02-24 10:28:41 +0800 |
commit | 538cb1cd010a3323ad61239a12a4134ef4dceca6 (patch) | |
tree | 0a2c492ce5d27c77da039aa5189b67aa3070aa20 /src/extend/camera.h | |
parent | b656c9415a8e7e3b5b7d8bf1f3c8a5444f830c79 (diff) |
*camera
Diffstat (limited to 'src/extend/camera.h')
-rw-r--r-- | src/extend/camera.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/extend/camera.h b/src/extend/camera.h index 8227dbf..e43efe6 100644 --- a/src/extend/camera.h +++ b/src/extend/camera.h @@ -4,6 +4,7 @@ #include "../math/math.h" #include "transform.h" #include "../extern/wog.h" +#include "../extern/wog.h" #undef near #undef far @@ -16,7 +17,16 @@ typedef struct { Mat4 proj_matrix; bool is_viewdirty, is_projdirty; /*operations*/ - float zoom_speed; + float zoom_speed; + Vec2 rotate_sensitivity; + Vec2 move_sensitivity; + Euler euler; + /*events*/ + bool look_around; + Vec2 mouse_prev; + bool move_around; + /*window*/ + wog_Window* wnd; } Camera; typedef struct CameraConfig { @@ -24,11 +34,12 @@ typedef struct CameraConfig { Vec3 pos; }CameraConfig; -void camera_init(Camera* cam); +void camera_init(Camera* cam, wog_Window* wnd); void camera_setposition(float x, float y, float z); -void camera_onevent(Camera* cam, wog_Event* e); +void camera_onevent(Camera* cam, wog_Event* e, float dt); +void camera_onupdate(Camera* cam, float dt); void camera_getmatrix(Mat4* view, Mat4* proj); |