Mercurial > fife-parpg
diff engine/core/util/math/matrix.h @ 482:16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
author | helios2000@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 29 Apr 2010 13:51:45 +0000 |
parents | 9ec572a5a944 |
children | 356634098bd9 |
line wrap: on
line diff
--- a/engine/core/util/math/matrix.h Wed Apr 28 21:33:11 2010 +0000 +++ b/engine/core/util/math/matrix.h Thu Apr 29 13:51:45 2010 +0000 @@ -223,6 +223,10 @@ assert(ind > -1 && ind < 16); return m[ind]; } + inline const T& operator[] (int ind) const { + assert(ind > -1 && ind < 16); + return m[ind]; + } /** Apply the matrix dot product to this matrix */ @@ -374,7 +378,8 @@ /** Print coords of the Matrix to a stream */ template<typename T> - std::ostream& operator<<(std::ostream& os, Matrix<T>& m) { + std::ostream& operator<<(std::ostream& os, const Matrix<T>& m) { + return os << "\n|" << m[0] << "," << m[4] << "," << m[8] << "," << m[12] << "|\n" << \ "|" << m[1] << "," << m[5] << "," << m[9] << "," << m[13] << "|\n" << \ "|" << m[2] << "," << m[6] << "," << m[10] << "," << m[14] << "|\n" << \