summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-09 10:50:38 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-09 10:50:38 +0200
commit372dbbb994a1414369fe38367d458a0c32866a79 (patch)
tree5cd564fbb0c4b7c0b47f3cb64594c34f9361f1dc /src/Vector3.h
parentUpdated generator prefabs to current Gallery contents. (diff)
parentAdded extra space before comments (diff)
downloadcuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar.gz
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar.bz2
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar.lz
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar.xz
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.tar.zst
cuberite-372dbbb994a1414369fe38367d458a0c32866a79.zip
Diffstat (limited to 'src/Vector3.h')
-rw-r--r--src/Vector3.h21
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