Tweaked the invert() method to avoid silly OSX warnings.

This commit is contained in:
Robert Osfield
2006-07-31 14:49:36 +00:00
parent b1994cc60d
commit 28cf404a25
2 changed files with 4 additions and 8 deletions

View File

@@ -200,10 +200,8 @@ class OSG_EXPORT Matrixd
/** invert the matrix rhs, automatically select invert_4x3 or invert_4x4. */
inline bool invert( const Matrixd& rhs)
{
if (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0)
return invert_4x3(rhs);
else
return invert_4x4(rhs);
bool is_4x3 = (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0);
return is_4x3 ? invert_4x3(rhs) : invert_4x4(rhs);
}
/** 4x3 matrix invert, not right hand column is assumed to be 0,0,0,1. */

View File

@@ -200,10 +200,8 @@ class OSG_EXPORT Matrixf
/** invert the matrix rhs, automatically select invert_4x3 or invert_4x4. */
inline bool invert( const Matrixf& rhs)
{
if (rhs._mat[0][3]==0.0 && rhs._mat[1][3]==0.0 && rhs._mat[2][3]==0.0 && rhs._mat[3][3]==1.0)
return invert_4x3(rhs);
else
return invert_4x4(rhs);
bool is_4x3 = (rhs._mat[0][3]==0.0f && rhs._mat[1][3]==0.0f && rhs._mat[2][3]==0.0f && rhs._mat[3][3]==1.0f);
return is_4x3 ? invert_4x3(rhs) : invert_4x4(rhs);
}
/** 4x3 matrix invert, not right hand column is assumed to be 0,0,0,1. */