From 5584144be2f0747d35f0828413d5441af4a277ee Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Thu, 13 Nov 2014 10:44:36 +0100 Subject: First implementation for the LargeOakTree --- src/Vector3.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Vector3.h') diff --git a/src/Vector3.h b/src/Vector3.h index 1854e42e3..1e4a1f5d9 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -93,6 +93,21 @@ public: return x * a_Rhs.x + y * a_Rhs.y + z * a_Rhs.z; } + inline void abs() + { + x = (x < 0) ? -x : x; + y = (y < 0) ? -y : y; + z = (z < 0) ? -z : z; + } + + // We can't use a capital letter, because we wouldn't be able to call the normal Clamp function. + inline void clamp(T a_Min, T a_Max) + { + x = Clamp(x, a_Min, a_Max); + y = Clamp(y, a_Min, a_Max); + z = Clamp(z, a_Min, a_Max); + } + inline Vector3 Cross(const Vector3 & a_Rhs) const { return Vector3( -- cgit v1.2.3