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>2010-10-04 16:59:52 +0000
committerStijn Buys <ingar@osirion.org>2010-10-04 16:59:52 +0000
commit3d97c7737fdda88c5d5d9e3e7d13f4c1973c7774 (patch)
treef4ee6f9e88645f76786589f1cb929eade66ce858 /src/math
parent81acfb7cd3ced1e613acaf45b44867e56b137dc9 (diff)
corrected modelview rotation to radians
Diffstat (limited to 'src/math')
-rw-r--r--src/math/axis.cc6
-rw-r--r--src/math/axis.h25
2 files changed, 23 insertions, 8 deletions
diff --git a/src/math/axis.cc b/src/math/axis.cc
index 402b2f6..8273469 100644
--- a/src/math/axis.cc
+++ b/src/math/axis.cc
@@ -84,10 +84,10 @@ void Axis::change_roll(const float angle)
/* notes:
http://mathworld.wolfram.com/RotationFormula.html
*/
-void Axis::rotate(Vector3f const &normal, float angle)
+void Axis::rotate(Vector3f const &normal, float rad)
{
- float cosa = cosf(angle);
- float sina = sinf(angle);
+ float cosa = cosf(rad);
+ float sina = sinf(rad);
for (size_t i = 0; i < 3; i++) {
axis_vector[i] =
diff --git a/src/math/axis.h b/src/math/axis.h
index 0ece016..c22568c 100644
--- a/src/math/axis.h
+++ b/src/math/axis.h
@@ -52,17 +52,32 @@ public:
const Axis operator*(const Axis &other) const;
- /// change direction, rotate around up vector (positive is left)
+ /**
+ * @brief change axis direction angle
+ * rotate around axis up vector (positive is left)
+ * @param angle angle in degrees
+ **/
void change_direction(const float angle);
- /// change pitch, rotate around left vector (positive is up)
+ /**
+ * @brief change axis pitch angle
+ * rotate around left vector (positive is up)
+ * @param angle angle in degrees
+ **/
void change_pitch(const float angle);
- /// change roll, rotate around forward vector (positive is left)
+ /**
+ * @brief change axis roll angle
+ * rotate around forward vector (positive is left)
+ * @param angle angle in degrees
+ **/
void change_roll(const float angle);
- /// rotation about an arbitrary axis
- void rotate(const Vector3f & normal, const float angle);
+ /**
+ * @brief rotation about an arbitrary vector
+ * @param rad angle in radians
+ **/
+ void rotate(const Vector3f & normal, const float rad);
/// return the transpose of this matrix
const Axis transpose() const;