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-11-18 13:50:47 +0000
committerStijn Buys <ingar@osirion.org>2010-11-18 13:50:47 +0000
commit847f84e1e3797277407bc34f5acc51b801b2bf29 (patch)
tree781edbf9e6663a4b6a8cfbaf173f43cfd83db62b /src/math
parent445f4a201f205763a2241d87ef81a99b5dd55d26 (diff)
Unified radiant angles conversion into a single math::Axis.assign() method, corrected transformation order.
Removed unnecessary model::LIGHTSCALE constant, light and flare sizes are rescaled according to the global model::SCALE. Added gl::depthfunc, enabled GL_LEQUAL while drawing lights and flares.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/axis.cc11
-rw-r--r--src/math/axis.h7
2 files changed, 18 insertions, 0 deletions
diff --git a/src/math/axis.cc b/src/math/axis.cc
index 3710c89..60d3797 100644
--- a/src/math/axis.cc
+++ b/src/math/axis.cc
@@ -44,6 +44,17 @@ void Axis::assign(const btMatrix3x3 & other)
}
}
+void Axis::assign(const float yaw, const float pitch, const float roll)
+{
+ clear();
+ if (yaw)
+ change_direction(yaw);
+ if (pitch)
+ change_pitch(-pitch);
+ if (roll)
+ change_roll(-roll);
+}
+
Axis & Axis::operator=(const Axis & other)
{
assign(other);
diff --git a/src/math/axis.h b/src/math/axis.h
index f9da159..3991843 100644
--- a/src/math/axis.h
+++ b/src/math/axis.h
@@ -26,6 +26,13 @@ public:
void assign(const Axis & other);
void assign(const btMatrix3x3 & other);
+
+ /**
+ * @brief assign radiant yaw, pitch and roll angles.
+ * This method changes the sign of the pitch and roll angles
+ * before applying them
+ */
+ void assign(const float yaw, const float pitch, const float roll);
/// global coordinates of the X-axis in the local coordinates system
inline const Vector3f & forward() const {