diff options
author | Brian Paul <[email protected]> | 2009-01-14 11:50:32 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-01-14 11:51:30 -0700 |
commit | c12d24b513a67648c30bf892964f887fad71e103 (patch) | |
tree | 38ddc080cbafca4de540f912982f836e8233ce5c /src/mesa/math/m_matrix.h | |
parent | 2549c26a8b1eec21bdd8f45d3b3dd06e17ac82ae (diff) |
mesa: fix incorrect transformation of GL_SPOT_DIRECTION
This was changed between GL 1.0 and 1.1. Mesa still had the 1.0 behaviour.
Diffstat (limited to 'src/mesa/math/m_matrix.h')
-rw-r--r-- | src/mesa/math/m_matrix.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index e8303f3ac5c..a8d9000e89b 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -189,6 +189,18 @@ 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) + + + /*@}*/ |