Commit b3ab720d authored by hybrid's avatar hybrid

Warning fix by maxim, and add multiplication order in docs

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3245 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9d1cc030
...@@ -22,16 +22,15 @@ ...@@ -22,16 +22,15 @@
//#define USE_MATRIX_TEST_DEBUG //#define USE_MATRIX_TEST_DEBUG
#if defined( USE_MATRIX_TEST_DEBUG ) #if defined( USE_MATRIX_TEST_DEBUG )
#include <windows.h>
struct MatrixTest struct MatrixTest
{ {
MatrixTest () : ID(0), Calls(0) {} MatrixTest () : ID(0), Calls(0) {}
char buf[256]; char buf[256];
int Calls; int Calls;
int ID; int ID;
}; };
static MatrixTest MTest; static MatrixTest MTest;
#endif #endif
...@@ -64,7 +63,7 @@ namespace core ...@@ -64,7 +63,7 @@ namespace core
//! Copy constructor //! Copy constructor
/** \param other Other matrix to copy from /** \param other Other matrix to copy from
\param constructor Choose the initialization style */ \param constructor Choose the initialization style */
CMatrix4( const CMatrix4<T>& other,eConstructor constructor = EM4CONST_COPY); CMatrix4(const CMatrix4<T>& other, eConstructor constructor = EM4CONST_COPY);
//! Simple operator for directly accessing every element of the matrix. //! Simple operator for directly accessing every element of the matrix.
T& operator()(const s32 row, const s32 col) T& operator()(const s32 row, const s32 col)
...@@ -125,17 +124,20 @@ namespace core ...@@ -125,17 +124,20 @@ namespace core
CMatrix4<T>& operator-=(const CMatrix4<T>& other); CMatrix4<T>& operator-=(const CMatrix4<T>& other);
//! set this matrix to the product of two matrices //! set this matrix to the product of two matrices
/** Calculate b*a */
inline CMatrix4<T>& setbyproduct(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b ); inline CMatrix4<T>& setbyproduct(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b );
//! Set this matrix to the product of two matrices //! Set this matrix to the product of two matrices
/** no optimization used, /** Calculate b*a, no optimization used,
use it if you know you never have a identity matrix */ use it if you know you never have a identity matrix */
CMatrix4<T>& setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b ); CMatrix4<T>& setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b );
//! Multiply by another matrix. //! Multiply by another matrix.
/** Calculate other*this */
CMatrix4<T> operator*(const CMatrix4<T>& other) const; CMatrix4<T> operator*(const CMatrix4<T>& other) const;
//! Multiply by another matrix. //! Multiply by another matrix.
/** Calculate and return other*this */
CMatrix4<T>& operator*=(const CMatrix4<T>& other); CMatrix4<T>& operator*=(const CMatrix4<T>& other);
//! Multiply by scalar. //! Multiply by scalar.
...@@ -1416,7 +1418,7 @@ namespace core ...@@ -1416,7 +1418,7 @@ namespace core
{ {
const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
_IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
const T w = h / aspectRatio; const T w = static_cast<T>(h / aspectRatio);
_IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
M[0] = w; M[0] = w;
...@@ -1455,7 +1457,7 @@ namespace core ...@@ -1455,7 +1457,7 @@ namespace core
{ {
const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
_IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
const T w = (T)(h / aspectRatio); const T w = static_cast<T>(h / aspectRatio);
_IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
M[0] = w; M[0] = w;
...@@ -1492,7 +1494,7 @@ namespace core ...@@ -1492,7 +1494,7 @@ namespace core
{ {
const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
_IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
const T w = (T)(h / aspectRatio); const T w = static_cast<T>(h / aspectRatio);
M[0] = w; M[0] = w;
M[1] = 0; M[1] = 0;
......
Tests finished. 52 tests of 52 passed. Tests finished. 54 tests of 54 passed.
Compiled as DEBUG Compiled as DEBUG
Test suite pass at GMT Thu Feb 18 11:54:08 2010 Test suite pass at GMT Thu Mar 11 23:23:09 2010
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