Math Lib: add mul_v3_mat3_m4v3
This commit is contained in:
parent
3f80accfb3
commit
9dadc8f599
|
@ -106,6 +106,7 @@ void mul_v2_m4v3(float r[2], float M[4][4], const float v[3]);
|
|||
void mul_v2_m2v2(float r[2], float M[2][2], const float v[2]);
|
||||
void mul_m2v2(float M[2][2], float v[2]);
|
||||
void mul_mat3_m4_v3(float M[4][4], float r[3]);
|
||||
void mul_v3_mat3_m4v3(float r[3], float M[4][4], const float v[3]);
|
||||
void mul_m4_v4(float M[4][4], float r[4]);
|
||||
void mul_v4_m4v4(float r[4], float M[4][4], const float v[4]);
|
||||
void mul_project_m4_v3(float M[4][4], float vec[3]);
|
||||
|
|
|
@ -504,6 +504,16 @@ void mul_mat3_m4_v3(float mat[4][4], float vec[3])
|
|||
vec[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2];
|
||||
}
|
||||
|
||||
void mul_v3_mat3_m4v3(float r[3], float mat[4][4], const float vec[3])
|
||||
{
|
||||
const float x = vec[0];
|
||||
const float y = vec[1];
|
||||
|
||||
r[0] = x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2];
|
||||
r[1] = x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2];
|
||||
r[2] = x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2];
|
||||
}
|
||||
|
||||
void mul_project_m4_v3(float mat[4][4], float vec[3])
|
||||
{
|
||||
const float w = mul_project_m4_v3_zfac(mat, vec);
|
||||
|
|
Loading…
Reference in New Issue