summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Defines.h8
-rw-r--r--src/Vector3.h10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/Defines.h b/src/Defines.h
index b7fd570b4..42978e740 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -425,6 +425,14 @@ extern eDamageType StringToDamageType(const AString & a_DamageString);
If a_Inverse is true, the opposite direction is used instead. */
void AddFaceDirection(int & a_BlockX, int & a_BlockY, int & a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse = false);
+/** Returns the coords of a block that is neighboring the specified position through its specified face.
+If a_IsInverse is true, the opposite direction is used instead. */
+inline Vector3i AddFaceDirection(Vector3i a_Pos, eBlockFace a_BlockFace, bool a_bInverse = false)
+{
+ AddFaceDirection(a_Pos.x, a_Pos.y, a_Pos.z, a_BlockFace, a_bInverse);
+ return a_Pos;
+}
+
// tolua_end
diff --git a/src/Vector3.h b/src/Vector3.h
index 1847baf5b..b3d54514b 100644
--- a/src/Vector3.h
+++ b/src/Vector3.h
@@ -178,6 +178,16 @@ public:
);
}
+ /** Returns a new Vector3i with coords set to std::ceil() of this vector's coords. */
+ inline Vector3<int> Ceil() const
+ {
+ return Vector3<int>(
+ CeilC(x),
+ CeilC(y),
+ CeilC(z)
+ );
+ }
+
// tolua_end
inline bool operator != (const Vector3<T> & a_Rhs) const