]> icculus.org git repositories - divverent/darkplaces.git/blob - matrix4x4.h
better check for 0 alpha (it now must be exactly 0.0f, not merely rounded off to...
[divverent/darkplaces.git] / matrix4x4.h
1
2 #ifndef MATRIX4X4_H
3 #define MATRIX4X4_H
4
5 // to get the vec3_t and vec4_t types
6 #include "mathlib.h"
7
8 typedef struct matrix4x4_s
9 {
10         float m[4][4];
11 }
12 matrix4x4_t;
13
14 void Matrix4x4_Copy (matrix4x4_t *out, matrix4x4_t *in);
15 void Matrix4x4_Concat (matrix4x4_t *out, const matrix4x4_t *in1, const matrix4x4_t *in2);
16 void Matrix4x4_Transpose (matrix4x4_t *out, const matrix4x4_t *in1);
17
18 void Matrix4x4_CreateIdentity (matrix4x4_t *out);
19 void Matrix4x4_CreateTranslate (matrix4x4_t *out, float x, float y, float z);
20 void Matrix4x4_CreateRotate (matrix4x4_t *out, float angle, float x, float y, float z);
21 void Matrix4x4_CreateScale (matrix4x4_t *out, float x);
22 void Matrix4x4_CreateScale3 (matrix4x4_t *out, float x, float y, float z);
23
24 void Matrix4x4_ToVectors(const matrix4x4_t *in, vec3_t vx, vec3_t vy, vec3_t vz, vec3_t t);
25 void Matrix4x4_ToVectors4(const matrix4x4_t *in, vec4_t vx, vec4_t vy, vec4_t vz, vec4_t t);
26 void Matrix4x4_FromVectors(matrix4x4_t *out, const vec3_t vx, const vec3_t vy, const vec3_t vz, const vec3_t t);
27 void Matrix4x4_FromVectors4(matrix4x4_t *out, const vec4_t vx, const vec4_t vy, const vec4_t vz, const vec4_t t);
28
29 void Matrix4x4_Transform (const matrix4x4_t *in, const vec3_t v, vec3_t out);
30 void Matrix4x4_Transform4 (const matrix4x4_t *in, const vec4_t v, vec4_t out);
31 void Matrix4x4_Untransform (const matrix4x4_t *in, const vec3_t v, vec3_t out);
32 void Matrix4x4_Untransform4 (const matrix4x4_t *in, const vec4_t v, vec4_t out);
33
34 void Matrix4x4_ConcatTranslate (matrix4x4_t *out, float x, float y, float z);
35 void Matrix4x4_ConcatRotate (matrix4x4_t *out, float angle, float x, float y, float z);
36 void Matrix4x4_ConcatScale (matrix4x4_t *out, float x);
37 void Matrix4x4_ConcatScale3 (matrix4x4_t *out, float x, float y, float z);
38
39 #endif