From ac3663d05da4e236d02620ae98d5a7e6882bc802 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 23 Nov 2008 22:12:02 +0000 Subject: math::Axis multiplication --- src/math/axis.cc | 9 +++++++++ src/math/axis.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'src/math') diff --git a/src/math/axis.cc b/src/math/axis.cc index 3c11de1..f7a1eec 100644 --- a/src/math/axis.cc +++ b/src/math/axis.cc @@ -107,6 +107,15 @@ Axis Axis::transpose() const return t; } +Axis Axis::operator*(const Axis &other) +{ + Axis t; + for (size_t i = 0; i < 3; i++) + t.axis_vector[i] = (*this) * other.axis_vector[i]; + + return t; +} + // write an axis to a std::ostream std::ostream &operator<<(std::ostream & os, Axis const & axis) { diff --git a/src/math/axis.h b/src/math/axis.h index 38c68de..3268d60 100644 --- a/src/math/axis.h +++ b/src/math/axis.h @@ -49,6 +49,8 @@ public: } Axis & operator=(const Axis & other); + + Axis operator*(const Axis &other); /// change direction, rotate around up vector (positive is left) void change_direction(const float angle); -- cgit v1.2.3