mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Add support for mat4 * vec3
This commit is contained in:
parent
50af8a562e
commit
730f9668bd
2 changed files with 12 additions and 0 deletions
|
@ -589,6 +589,7 @@ void QuatToMatrix (const quat_t q, vec_t *m, int homogenous, int vertical);
|
|||
|
||||
void Mat4Transpose (const mat4_t a, mat4_t b);
|
||||
void Mat4Mult (const mat4_t a, const mat4_t b, mat4_t c);
|
||||
void Mat4MultVec (const mat4_t a, const vec3_t b, vec3_t c);
|
||||
// Column major matrix
|
||||
int Mat4Decompose (const mat4_t m, quat_t rot, vec3_t scale, vec3_t shear,
|
||||
vec3_t trans);
|
||||
|
|
|
@ -832,6 +832,17 @@ Mat4Mult (const mat4_t a, const mat4_t b, mat4_t c)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mat4MultVec (const mat4_t a, const vec3_t b, vec3_t c)
|
||||
{
|
||||
int i;
|
||||
vec3_t tb;
|
||||
|
||||
VectorCopy (b, tb);
|
||||
for (i = 0; i < 3; i++)
|
||||
c[i] = a[i + 0] * tb[0] + a[i + 4] * b[1] + a[i + 8] * b[2] + a[i +12];
|
||||
}
|
||||
|
||||
int
|
||||
Mat4Decompose (const mat4_t m, quat_t rot, vec3_t scale, vec3_t shear,
|
||||
vec3_t trans)
|
||||
|
|
Loading…
Reference in a new issue