add guMatrixScale()

This commit is contained in:
Josh Holtrop 2011-05-09 16:45:07 -04:00
parent e76503001e
commit 9ad00aee7f
2 changed files with 13 additions and 0 deletions

View File

@ -46,6 +46,18 @@ void guMatrixTranslate(guMatrix4x4 *m, float x, float y, float z)
}
}
void guMatrixScale(guMatrix4x4 *m, float x, float y, float z)
{
int i;
for (i = 0; i < 4; i++)
{
float *base = &(*m)[i][0];
base[0] *= x;
base[1] *= y;
base[2] *= z;
}
}
void guMatrixFrustum(guMatrix4x4 *m,
float left, float right,
float bottom, float top,

View File

@ -17,6 +17,7 @@ extern "C" {
void guMatrixLoadIdentity(guMatrix4x4 *m);
void guMatrixMult(guMatrix4x4 *m, guMatrix4x4 *a, guMatrix4x4 *b);
void guMatrixTranslate(guMatrix4x4 *m, float x, float y, float z);
void guMatrixScale(guMatrix4x4 *m, float x, float y, float z);
void guMatrixFrustum(guMatrix4x4 *m,
float left, float right,
float bottom, float top,