diff options
Diffstat (limited to 'src/mesa/math/m_matrix.h')
-rw-r--r-- | src/mesa/math/m_matrix.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index e8303f3ac5..3bc5de6cd4 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -189,6 +189,21 @@ do { \ } while (0) +/** + * Transform a direction by a matrix. + */ +#define TRANSFORM_DIRECTION( TO, DIR, MAT ) \ +do { \ + TO[0] = DIR[0] * MAT[0] + DIR[1] * MAT[4] + DIR[2] * MAT[8]; \ + TO[1] = DIR[0] * MAT[1] + DIR[1] * MAT[5] + DIR[2] * MAT[9]; \ + TO[2] = DIR[0] * MAT[2] + DIR[1] * MAT[6] + DIR[2] * MAT[10];\ +} while (0) + + +extern void +_mesa_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16]); + + /*@}*/ |