Added functions to customize internal matrix

Internal modelview and projection matrices can be replaced before
drawing.
This commit is contained in:
raysan5 2016-06-02 20:23:09 +02:00
parent 2168d8aa1a
commit 0bc71d84f8
4 changed files with 26 additions and 10 deletions

View file

@ -339,15 +339,14 @@ RMDEF Vector3 VectorReflect(Vector3 vector, Vector3 normal)
return result;
}
// Transforms a Vector3 with a given Matrix
// Transforms a Vector3 by a given Matrix
// TODO: Review math (matrix transpose required?)
RMDEF void VectorTransform(Vector3 *v, Matrix mat)
{
float x = v->x;
float y = v->y;
float z = v->z;
//MatrixTranspose(&mat);
v->x = mat.m0*x + mat.m4*y + mat.m8*z + mat.m12;
v->y = mat.m1*x + mat.m5*y + mat.m9*z + mat.m13;
v->z = mat.m2*x + mat.m6*y + mat.m10*z + mat.m14;