Moved istream/ostream includes out of Vec3f, and reimpleted osg::Matrix*::compare.

This commit is contained in:
Robert Osfield 2005-04-17 10:41:23 +00:00
parent 62994ac4a2
commit 88e8477cbf
4 changed files with 14 additions and 5 deletions

View File

@ -43,7 +43,7 @@ class OSG_EXPORT Matrixd
~Matrixd() {}
int compare(const Matrixd& m) const { return memcmp(_mat,m._mat,sizeof(_mat)); }
int compare(const Matrixd& m) const;
bool operator < (const Matrixd& m) const { return compare(m)<0; }
bool operator == (const Matrixd& m) const { return compare(m)==0; }

View File

@ -43,7 +43,7 @@ class OSG_EXPORT Matrixf
~Matrixf() {}
int compare(const Matrixf& m) const { return memcmp(_mat,m._mat,sizeof(_mat)); }
int compare(const Matrixf& m) const;
bool operator < (const Matrixf& m) const { return compare(m)<0; }
bool operator == (const Matrixf& m) const { return compare(m)==0; }

View File

@ -14,9 +14,6 @@
#ifndef OSG_VEC3F
#define OSG_VEC3F 1
#include <ostream>
#include <istream>
#include <osg/Vec2f>
#include <osg/Math>

View File

@ -174,6 +174,18 @@ void Matrix_implementation::get( Quat& q ) const
}
}
int Matrix_implementation::compare(const Matrix_implementation& m) const
{
const Matrix_implementation::value_type* lhs = reinterpret_cast<const Matrix_implementation::value_type*>(_mat);
const Matrix_implementation::value_type* end_lhs = lhs+16;
const Matrix_implementation::value_type* rhs = reinterpret_cast<const Matrix_implementation::value_type*>(m._mat);
for(;lhs!=end_lhs;++lhs,++rhs)
{
if (*lhs < *rhs) return -1;
if (*rhs < *lhs) return 1;
}
return 0;
}
void Matrix_implementation::setTrans( value_type tx, value_type ty, value_type tz )
{