small updates and api changes
[carveJwlIkooP6JGAAIwe30JlM.git] / camera.h
index 314eafe08b65e532239c66c30ae1a6313ef93818..63743935e871a51b59108af102a1470320c067c4 100644 (file)
--- a/camera.h
+++ b/camera.h
@@ -4,9 +4,7 @@
 #include "skaterift.h"
 
 typedef struct camera camera;
-
-struct camera
-{
+struct camera{
    /* Input */
    v3f angles;
    v3f pos;
@@ -23,18 +21,15 @@ struct camera
    }
    mtx,
    mtx_prev;
-}
-static main_camera, gate_camera;
+};
 
-VG_STATIC void camera_lerp_angles( v3f a, v3f b, float t, v3f d )
-{
+VG_STATIC void camera_lerp_angles( v3f a, v3f b, float t, v3f d ){
    d[0] = vg_alerpf( a[0], b[0], t );
    d[1] = vg_lerpf(  a[1], b[1], t );
    d[2] = vg_lerpf(  a[2], b[2], t );
 }
 
-VG_STATIC void camera_lerp( camera *a, camera *b, float t, camera *d )
-{
+VG_STATIC void camera_lerp( camera *a, camera *b, float t, camera *d ){
    v3_lerp( a->pos, b->pos, t, d->pos );
    d->angles[0] = vg_alerpf( a->angles[0], b->angles[0], t );
    d->angles[1] = vg_lerpf( a->angles[1], b->angles[1], t );
@@ -42,6 +37,12 @@ VG_STATIC void camera_lerp( camera *a, camera *b, float t, camera *d )
    d->fov = vg_lerpf( a->fov, b->fov, t );
 }
 
+VG_STATIC void camera_copy( camera *a, camera *d ){
+   v3_copy( a->pos, d->pos );
+   v3_copy( a->angles, d->angles );
+   d->fov = a->fov;
+}
+
 /*
  * 1) [angles, pos] -> transform 
  */