Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-12-30 23:15:48 +0000
committerStijn Buys <ingar@osirion.org>2012-12-30 23:15:48 +0000
commit5773da9e78a61daf5bd2a3ee0504683e56af72f5 (patch)
tree3fa81e278e6c803be19362a25c1b3727d8e177e8 /src/math/axis.cc
parent93dd038acea20774143dde34bd924f6eb0d3568a (diff)
Added math::Axis::rotate() variant.
Diffstat (limited to 'src/math/axis.cc')
-rw-r--r--src/math/axis.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/math/axis.cc b/src/math/axis.cc
index 60d3797..a5ea397 100644
--- a/src/math/axis.cc
+++ b/src/math/axis.cc
@@ -104,11 +104,8 @@ void Axis::change_roll(const float angle)
/* notes:
http://mathworld.wolfram.com/RotationFormula.html
*/
-void Axis::rotate(Vector3f const &normal, float rad)
+void Axis::rotate(Vector3f const &normal, float cosa, float sina)
{
- float cosa = cosf(rad);
- float sina = sinf(rad);
-
for (size_t i = 0; i < 3; i++) {
axis_vector[i] =
axis_vector[i] * cosa +
@@ -116,6 +113,10 @@ void Axis::rotate(Vector3f const &normal, float rad)
crossproduct(axis_vector[i], normal) * sina;
}
}
+void Axis::rotate(Vector3f const &normal, float rad)
+{
+ rotate(normal, cosf(rad), sinf(rad));
+}
const Axis Axis::transpose() const
{