Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-11-23 22:12:02 +0000
committerStijn Buys <ingar@osirion.org>2008-11-23 22:12:02 +0000
commitac3663d05da4e236d02620ae98d5a7e6882bc802 (patch)
tree2925b8239db3c54df62aa24a75fd2f786104baa5 /src/math
parent583ec3285c41e9d253c4aaabd2af4dadac75f3a7 (diff)
math::Axis multiplication
Diffstat (limited to 'src/math')
-rw-r--r--src/math/axis.cc9
-rw-r--r--src/math/axis.h2
2 files changed, 11 insertions, 0 deletions
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);