From f5266b403c50cb2b6d712e6d8f41b62ad2433efb Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 1 May 2008 12:41:31 +0000 Subject: lights --- src/math/axis.cc | 10 +++++++++- src/math/axis.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/math') diff --git a/src/math/axis.cc b/src/math/axis.cc index 6f9710b..4d752bf 100644 --- a/src/math/axis.cc +++ b/src/math/axis.cc @@ -89,7 +89,9 @@ Axis const Axis::transpose() // write an axis to a std::ostream std::ostream &operator<<(std::ostream & os, Axis const & axis) { - os << axis.forward() << " " << axis.left() << " " << axis.up(); + os << axis.forward() << " "; + os << axis.left() << " "; + os << axis.up(); return os; } @@ -102,4 +104,10 @@ std::istream &operator>>(std::istream & is, Axis & axis) return is; } +// local-to-global coordinates +Vector3f operator*(Axis const &axis, Vector3f const &vector) +{ + return (Vector3f(vector[0] * axis[0] + vector[1] * axis[1] + vector[2] * axis[2])); +} + } diff --git a/src/math/axis.h b/src/math/axis.h index 7e81d9a..d011675 100644 --- a/src/math/axis.h +++ b/src/math/axis.h @@ -58,6 +58,9 @@ std::ostream &operator<<(std::ostream & os, Axis const & axis); /// read an axis from a std::istream std::istream &operator>>(std::istream & is, Axis & axis); +/// local-to-global coordinates +Vector3f operator*(Axis const &axis, Vector3f const &vector); + } #endif // __INCLUDED_MATH_AXIS_H__ -- cgit v1.2.3