diff --git a/matrix.hpp b/matrix.hpp index 43668483..c77c25b7 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -225,6 +225,19 @@ namespace util { template matrix<4,4,T> rotation (T angle, vector<3,T> about); + template + bool + relatively_equal (const util::matrix &a, + const util::matrix &b, + const float percentage) + { + for (size_t r = 0; r < Rows; ++r) + if (!all (relatively_equal (a[r], b[r], percentage))) + return false; + return true; + } + + /////////////////////////////////////////////////////////////////////////// // Convert an affine rotation matrix to euler angles. //