From 7d77992ed7c8afcb8dd42b643d498530d92c0243 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 12 Dec 2016 18:54:54 -0800 Subject: [PATCH] Add equality operators for CTransform and CMatrix3f --- include/zeus/CMatrix3f.hpp | 5 +++++ include/zeus/CTransform.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/zeus/CMatrix3f.hpp b/include/zeus/CMatrix3f.hpp index 0728cf2..308ec40 100644 --- a/include/zeus/CMatrix3f.hpp +++ b/include/zeus/CMatrix3f.hpp @@ -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(); diff --git a/include/zeus/CTransform.hpp b/include/zeus/CTransform.hpp index 9d31bd0..8184ee9 100644 --- a/include/zeus/CTransform.hpp +++ b/include/zeus/CTransform.hpp @@ -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));