diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-01 12:41:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-01 12:41:31 +0000 |
commit | f5266b403c50cb2b6d712e6d8f41b62ad2433efb (patch) | |
tree | fbd1cbafbb6d43b2fd5838cff8ce85df245bac86 /src/math | |
parent | e2b18c44a6ae38bb84f717c86988a80da137c3e7 (diff) |
lights
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/axis.cc | 10 | ||||
-rw-r--r-- | src/math/axis.h | 3 |
2 files changed, 12 insertions, 1 deletions
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__ |