diff --git a/matrix.cpp b/matrix.cpp index 7a3bdf81..d556e8c0 100644 --- a/matrix.cpp +++ b/matrix.cpp @@ -255,6 +255,26 @@ matrix::operator*=(const matrix &rhs) { } +/////////////////////////////////////////////////////////////////////////////// +template +vector<3,T> +matrix::operator* (vector<3,T> v) const +{ + return ( + *this * v.template homog<4> () + ).template redim<3> (); +} + + +//----------------------------------------------------------------------------- +template +point<3,T> +matrix::operator* (point<3,T> p) const +{ + return (*this * p.template homog<4> ()).template redim<3> (); +} + + //----------------------------------------------------------------------------- template vector<4,T> diff --git a/matrix.hpp b/matrix.hpp index a320ff60..473eaaf1 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -42,6 +42,9 @@ namespace util { matrix operator* (const matrix&) const; matrix& operator*=(const matrix&); + vector<3,T> operator* (vector<3,T>) const; + point<3,T> operator* (point<3,T>) const; + vector<4,T> operator* (const vector<4,T>&) const; point<4,T> operator* (const point<4,T> &) const;