summaryrefslogtreecommitdiffstats
path: root/source/BoundingBox.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-01 19:08:51 +0200
committermadmaxoft <github@xoft.cz>2013-09-01 19:08:51 +0200
commit5fccd67bada2be7a3fbb2df3abf08bfde58b600b (patch)
treea749a026da43825f945fa3a3b666f1d2e8adedf6 /source/BoundingBox.h
parentRenamed BLOCK_FACE constants to use the new coord-wise names. (diff)
downloadcuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar.gz
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar.bz2
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar.lz
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar.xz
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.tar.zst
cuberite-5fccd67bada2be7a3fbb2df3abf08bfde58b600b.zip
Diffstat (limited to 'source/BoundingBox.h')
-rw-r--r--source/BoundingBox.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/BoundingBox.h b/source/BoundingBox.h
index 5a07df20e..7b6391942 100644
--- a/source/BoundingBox.h
+++ b/source/BoundingBox.h
@@ -51,6 +51,22 @@ public:
/// Returns true if a boundingbox specified by a_Min and a_Max is inside this bounding box
bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max);
+ /// Returns true if the specified point is inside the bounding box specified by its min/max corners
+ static bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max, const Vector3d & a_Point);
+
+ /// Returns true if the specified point is inside the bounding box specified by its min/max corners
+ static bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max, double a_X, double a_Y, double a_Z);
+
+ /** Returns true if this bounding box is intersected by the line specified by its two points
+ Also calculates the distance along the line in which the intersection occurs (0 .. 1)
+ */
+ bool CalcLineIntersection(const Vector3d & a_Line1, const Vector3d & a_Line2, double & a_LineCoeff, char & a_Face);
+
+ /** Returns true if the specified bounding box is intersected by the line specified by its two points
+ Also calculates the distance along the line in which the intersection occurs (0 .. 1) and the face hit (BLOCK_FACE_ constants)
+ */
+ static bool CalcLineIntersection(const Vector3d & a_Min, const Vector3d & a_Max, const Vector3d & a_Line1, const Vector3d & a_Line2, double & a_LineCoeff, char & a_Face);
+
// tolua_end
/// Calculates the intersection of the two bounding boxes; returns true if nonempty