dead
[carveJwlIkooP6JGAAIwe30JlM.git] / camera.h
index 596409937ceb3cf2f532c7d22f2c999533bd9fa7..77fc0893f4e885e6766e001617b23b2bab33bcb6 100644 (file)
--- a/camera.h
+++ b/camera.h
@@ -8,7 +8,7 @@ typedef struct camera camera;
 struct camera
 {
    /* Input */
-   v2f angles;
+   v3f angles;
    v3f pos;
    float fov, nearz, farz;
 
@@ -27,6 +27,22 @@ struct camera
 }
 VG_STATIC main_camera;
 
+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 )
+{
+   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 );
+   d->angles[2] = vg_lerpf( a->angles[2], b->angles[2], t );
+   d->fov = vg_lerpf( a->fov, b->fov, t );
+}
+
 /*
  * 1) [angles, pos] -> transform 
  */