diff --git a/geom/ray.cpp b/geom/ray.cpp index 5956ac69..433d1a7f 100644 --- a/geom/ray.cpp +++ b/geom/ray.cpp @@ -44,6 +44,17 @@ ray::at (T t) const } +/////////////////////////////////////////////////////////////////////////////// +util::geom::ray3f +util::geom::operator* (util::matrix4f lhs, ray3f rhs) +{ + return { + (lhs * rhs.origin.homog<4> ()).redim<3> (), + (lhs * rhs.direction.homog<4> ()).redim<3> () + }; +} + + /////////////////////////////////////////////////////////////////////////////// template std::ostream& diff --git a/geom/ray.hpp b/geom/ray.hpp index 376a74d5..dc782d93 100644 --- a/geom/ray.hpp +++ b/geom/ray.hpp @@ -66,6 +66,11 @@ namespace util::geom { typedef ray<3,float> ray3f; + /////////////////////////////////////////////////////////////////////////// + ray3f + operator* (matrix4f, ray3f); + + /////////////////////////////////////////////////////////////////////////// /// returns the distance along the ray in a ray-plane intersection ///