Add equality operators for CTransform and CMatrix3f

This commit is contained in:
Phillip Stephens 2016-12-12 18:54:54 -08:00
parent a136d77458
commit 7d77992ed7
2 changed files with 10 additions and 0 deletions

View File

@ -157,6 +157,11 @@ public:
return ret;
}
inline bool operator==(const CMatrix3f& other) const
{
return vec[0] == other.vec[0] && vec[1] == other.vec[1] && vec[2] == other.vec[2];
}
static const CMatrix3f skIdentityMatrix3f;
void transpose();

View File

@ -31,6 +31,11 @@ public:
static inline CTransform Identity() { return CTransform(CMatrix3f::skIdentityMatrix3f); }
inline bool operator ==(const CTransform& other) const
{
return origin == other.origin && basis == other.basis;
}
inline CTransform operator*(const CTransform& rhs) const
{
return CTransform(basis * rhs.basis, origin + (basis * rhs.origin));