X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=camera.h;h=7d720f7ca0f18214cb2735af044dbb72cd7f323b;hb=4b8fc63f926737ca0593a4e471550f9f4995c538;hp=77fc0893f4e885e6766e001617b23b2bab33bcb6;hpb=e3bf80ff27b675f5e7f87dcebd16fab6fe08df7a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/camera.h b/camera.h index 77fc089..7d720f7 100644 --- a/camera.h +++ b/camera.h @@ -1,12 +1,10 @@ #ifndef CAMERA_H #define CAMERA_H -#include "common.h" +#include "skaterift.h" typedef struct camera camera; - -struct camera -{ +struct camera{ /* Input */ v3f angles; v3f pos; @@ -16,16 +14,14 @@ struct camera m4x3f transform, transform_inverse; - struct camera_mtx - { + struct camera_mtx{ m4x4f p, v, pv; } mtx, mtx_prev; -} -VG_STATIC main_camera; +}; VG_STATIC void camera_lerp_angles( v3f a, v3f b, float t, v3f d ) { @@ -49,7 +45,7 @@ VG_STATIC void camera_lerp( camera *a, camera *b, float t, camera *d ) VG_STATIC void camera_update_transform( camera *cam ) { v4f qyaw, qpitch, qcam; - q_axis_angle( qyaw, (v3f){ 0.0f, 1.0f, 0.0f }, -cam->angles[0] ); + q_axis_angle( qyaw, (v3f){ 0.0f, 1.0f, 0.0f }, -cam->angles[0] ); q_axis_angle( qpitch, (v3f){ 1.0f, 0.0f, 0.0f }, -cam->angles[1] ); q_mul( qyaw, qpitch, qcam );