From 876a6030bbc3ebeb37aae46ffc66f5d6fc337c5e Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 15 Feb 2016 19:49:52 -1000 Subject: [PATCH] More CTransform affine operators --- include/CTransform.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/CTransform.hpp b/include/CTransform.hpp index 25784d0..5ab987b 100644 --- a/include/CTransform.hpp +++ b/include/CTransform.hpp @@ -43,12 +43,28 @@ public: static inline CTransform Translate(float x, float y, float z) { return Translate({x, y, z}); } + inline CTransform operator+(const CVector3f& other) + { + return CTransform(m_basis, m_origin + other); + } + inline CTransform& operator+=(const CVector3f& other) { m_origin += other; return *this; } + inline CTransform operator-(const CVector3f& other) + { + return CTransform(m_basis, m_origin - other); + } + + inline CTransform& operator-=(const CVector3f& other) + { + m_origin -= other; + return *this; + } + inline void rotate(const CVector3f& euler) { *this = *this * CMatrix3f(CQuaternion(euler)); } static inline CTransform RotateX(float theta)