Commit 11fc4820 authored by cutealien's avatar cutealien

Update documentation.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5066 dfc29bdd-3216-0410-991c-e03cc46cb475
parent cf229fdd
...@@ -10,10 +10,15 @@ ...@@ -10,10 +10,15 @@
#include "matrix4.h" #include "matrix4.h"
#include "vector3d.h" #include "vector3d.h"
// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed. // NOTE: You *only* need this when updating an application from Irrlicht before 1.8 to Irrlicht 1.8 or later.
// This define disables all involved functions completely to allow finding all places // Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions changed.
// where the wrong conversions had been in use. // Before the fix they had mixed left- and right-handed rotations.
#define IRR_TEST_BROKEN_QUATERNION_USE 0 // To test if your code was affected by the change enable IRR_TEST_BROKEN_QUATERNION_USE and try to compile your application.
// This defines removes those functions so you get compile errors anywhere you use them in your code.
// For every line with a compile-errors you have to change the corresponding lines like that:
// - When you pass the matrix to the quaternion constructor then replace the matrix by the transposed matrix.
// - For uses of getMatrix() you have to use quaternion::getMatrix_transposed instead.
// #define IRR_TEST_BROKEN_QUATERNION_USE
namespace irr namespace irr
{ {
...@@ -39,7 +44,7 @@ class quaternion ...@@ -39,7 +44,7 @@ class quaternion
//! Constructor which converts euler angles (radians) to a quaternion //! Constructor which converts euler angles (radians) to a quaternion
quaternion(const vector3df& vec); quaternion(const vector3df& vec);
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
//! Constructor which converts a matrix to a quaternion //! Constructor which converts a matrix to a quaternion
quaternion(const matrix4& mat); quaternion(const matrix4& mat);
#endif #endif
...@@ -53,7 +58,7 @@ class quaternion ...@@ -53,7 +58,7 @@ class quaternion
//! Assignment operator //! Assignment operator
inline quaternion& operator=(const quaternion& other); inline quaternion& operator=(const quaternion& other);
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
//! Matrix assignment operator //! Matrix assignment operator
inline quaternion& operator=(const matrix4& other); inline quaternion& operator=(const matrix4& other);
#endif #endif
...@@ -98,7 +103,7 @@ class quaternion ...@@ -98,7 +103,7 @@ class quaternion
//! Normalizes the quaternion //! Normalizes the quaternion
inline quaternion& normalize(); inline quaternion& normalize();
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
//! Creates a matrix from this quaternion //! Creates a matrix from this quaternion
matrix4 getMatrix() const; matrix4 getMatrix() const;
#endif #endif
...@@ -196,7 +201,7 @@ inline quaternion::quaternion(const vector3df& vec) ...@@ -196,7 +201,7 @@ inline quaternion::quaternion(const vector3df& vec)
set(vec.X,vec.Y,vec.Z); set(vec.X,vec.Y,vec.Z);
} }
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
// Constructor which converts a matrix to a quaternion // Constructor which converts a matrix to a quaternion
inline quaternion::quaternion(const matrix4& mat) inline quaternion::quaternion(const matrix4& mat)
{ {
...@@ -229,7 +234,7 @@ inline quaternion& quaternion::operator=(const quaternion& other) ...@@ -229,7 +234,7 @@ inline quaternion& quaternion::operator=(const quaternion& other)
return *this; return *this;
} }
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
// matrix assignment operator // matrix assignment operator
inline quaternion& quaternion::operator=(const matrix4& m) inline quaternion& quaternion::operator=(const matrix4& m)
{ {
...@@ -333,7 +338,7 @@ inline quaternion quaternion::operator+(const quaternion& b) const ...@@ -333,7 +338,7 @@ inline quaternion quaternion::operator+(const quaternion& b) const
return quaternion(X+b.X, Y+b.Y, Z+b.Z, W+b.W); return quaternion(X+b.X, Y+b.Y, Z+b.Z, W+b.W);
} }
#if !IRR_TEST_BROKEN_QUATERNION_USE #ifndef IRR_TEST_BROKEN_QUATERNION_USE
// Creates a matrix from this quaternion // Creates a matrix from this quaternion
inline matrix4 quaternion::getMatrix() const inline matrix4 quaternion::getMatrix() const
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment