X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=camera.h;h=7aa1b14a92eb6b29f03338765587b3afe07dd949;hb=HEAD;hp=07205de223417ce84a392b4a8406043f0a260248;hpb=06e35432f5cf2b4e9ad2f537393511867f64d29a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/camera.h b/camera.h deleted file mode 100644 index 07205de..0000000 --- a/camera.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CAMERA_H -#define CAMERA_H - -#include "common.h" - -static v2f camera_angles; -static v3f camera_pos; - -static m4x3f camera_mtx, - camera_mtx_inverse; - -static void camera_update(void) -{ - /* Update camera matrices */ - v4f qyaw, qpitch, qcam; - q_axis_angle( qyaw, (v3f){ 0.0f, 1.0f, 0.0f }, -camera_angles[0] ); - q_axis_angle( qpitch, (v3f){ 1.0f, 0.0f, 0.0f }, -camera_angles[1] ); - - q_mul( qyaw, qpitch, qcam ); - q_m3x3( qcam, camera_mtx ); - v3_copy( camera_pos, camera_mtx[3] ); - - m4x3_invert_affine( camera_mtx, camera_mtx_inverse ); -} - -#endif /* CAMERA_H */