X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=camera.h;h=7aa1b14a92eb6b29f03338765587b3afe07dd949;hb=HEAD;hp=7bd14e64e6c0eefd4db4d71d6d79cbb4fe8d2558;hpb=d171c9ad5de05c9ac8563fcf9f23760b93fb50f8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/camera.h b/camera.h index 7bd14e6..7aa1b14 100644 --- a/camera.h +++ b/camera.h @@ -1,7 +1,5 @@ -#ifndef CAMERA_H -#define CAMERA_H - -#include "skaterift.h" +#pragma once +#if 0 typedef struct camera camera; struct camera{ @@ -95,37 +93,4 @@ static void camera_finalize( camera *cam ) m4x4_copy( cam->mtx.pv, cam->mtx_prev.pv ); m4x4_mul( cam->mtx.p, cam->mtx.v, cam->mtx.pv ); } - -/* - * http://www.terathon.com/lengyel/Lengyel-Oblique.pdf - */ -static void m4x4_clip_projection( m4x4f mat, v4f plane ) -{ - v4f c = - { - (vg_signf(plane[0]) + mat[2][0]) / mat[0][0], - (vg_signf(plane[1]) + mat[2][1]) / mat[1][1], - -1.0f, - (1.0f + mat[2][2]) / mat[3][2] - }; - - v4_muls( plane, 2.0f / v4_dot(plane,c), c ); - - mat[0][2] = c[0]; - mat[1][2] = c[1]; - mat[2][2] = c[2] + 1.0f; - mat[3][2] = c[3]; -} - -/* - * Undoes the above operation - */ -static void m4x4_reset_clipping( m4x4f mat, float ffar, float fnear ) -{ - mat[0][2] = 0.0f; - mat[1][2] = 0.0f; - mat[2][2] = -(ffar + fnear) / (ffar - fnear); - mat[3][2] = -2.0f * ffar * fnear / (ffar - fnear); -} - -#endif /* CAMERA_H */ +#endif