diff options
Diffstat (limited to 'maths.h')
-rw-r--r-- | maths.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -4,6 +4,7 @@ #define mini(a_, b_) ((a_) < (b_) ? (a_) : (b_)) #define maxi(a_, b_) ((a_) > (b_) ? (a_) : (b_)) #define clamp(v_, min_, max_) (maxi(min_, mini(max_, v_))) +#define absolute(v_) ((v_) < 0? -(v_): (v_)) #define fbits 9 #define f1 (1 << fbits) @@ -19,6 +20,8 @@ extern int sqrt_table[sqrt_table_count]; void init_maths(void); +int fpow(int a, int p); + int* mtx_iden(int* m); int* mtx_cpy(int* d, const int* s); int* mtx_mul(int* d, const int* a, const int* b); @@ -36,6 +39,8 @@ int* mtx_rot_y(int* d, int a); int* mtx_rot_z(int* d, int a); int* mtx_apply(const int* m, int* v); int* vec_cpy(int* d, const int* s, int c); +int* vec_ref(int* d, const int* i, const int* n, int c); +int vec_dot(const int* a, const int* b, int d); void persp(int* v, int asp); void ndc2clip(int* c, int* p); |