aboutsummaryrefslogtreecommitdiffstats
path: root/common/vecmat.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/vecmat.h')
-rw-r--r--common/vecmat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/vecmat.h b/common/vecmat.h
index 62cba193..78fd806e 100644
--- a/common/vecmat.h
+++ b/common/vecmat.h
@@ -35,6 +35,13 @@ public:
return *this;
}
+ VectorR operator-(const VectorR &rhs) const noexcept
+ {
+ const VectorR ret{mVals[0] - rhs.mVals[0], mVals[1] - rhs.mVals[1],
+ mVals[2] - rhs.mVals[2], mVals[3] - rhs.mVals[3]};
+ return ret;
+ }
+
T normalize(T limit = std::numeric_limits<T>::epsilon())
{
limit = std::max(limit, std::numeric_limits<T>::epsilon());