diff options
author | archshift <admin@archshift.com> | 2014-07-10 08:28:27 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-07-10 08:28:27 +0200 |
commit | e824cd09b369c47a7f316fccc7577cd923164466 (patch) | |
tree | d8efa178a29955525458a38b1351ea0b609a2a09 /src/Vector3.h | |
parent | EntityEffects.x -> EntityEffect.x, Object-Oriented effects (diff) | |
parent | Merge pull request #1157 from Howaner/Window (diff) | |
download | cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.gz cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.bz2 cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.lz cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.xz cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.zst cuberite-e824cd09b369c47a7f316fccc7577cd923164466.zip |
Diffstat (limited to 'src/Vector3.h')
-rw-r--r-- | src/Vector3.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Vector3.h b/src/Vector3.h index 5faac1457..9e855b8af 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -134,6 +134,16 @@ public: z += a_Diff.z; } + /** Runs each value of the vector through std::floor() */ + inline Vector3<int> Floor(void) const + { + return Vector3<int>( + (int)floor(x), + (int)floor(y), + (int)floor(z) + ); + } + // tolua_end inline bool operator != (const Vector3<T> & a_Rhs) const @@ -146,6 +156,16 @@ public: return Equals(a_Rhs); } + inline bool operator > (const Vector3<T> & a_Rhs) const + { + return (SqrLength() > a_Rhs.SqrLength()); + } + + inline bool operator < (const Vector3<T> & a_Rhs) const + { + return (SqrLength() < a_Rhs.SqrLength()); + } + inline void operator += (const Vector3<T> & a_Rhs) { x += a_Rhs.x; @@ -288,6 +308,7 @@ protected: { return (a_Value < 0) ? -a_Value : a_Value; } + }; // tolua_end |