diff options
author | Mattes D <github@xoft.cz> | 2016-06-05 18:23:16 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-06-05 18:23:16 +0200 |
commit | c2759186c09dc981aa672fecb57cce4aea722ec6 (patch) | |
tree | ece066d1c1f8e5ebe4a0da9cf918e06094002188 /src/BoundingBox.h | |
parent | Bindings: Add a const-ptr variant to all stack getter functions (diff) | |
download | cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar.gz cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar.bz2 cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar.lz cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar.xz cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.tar.zst cuberite-c2759186c09dc981aa672fecb57cce4aea722ec6.zip |
Diffstat (limited to 'src/BoundingBox.h')
-rw-r--r-- | src/BoundingBox.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/BoundingBox.h b/src/BoundingBox.h index c2aa40dc7..38d567562 100644 --- a/src/BoundingBox.h +++ b/src/BoundingBox.h @@ -63,20 +63,25 @@ public: /** 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); + // tolua_end + /** 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) - Only forward collisions (a_LineCoeff >= 0) are returned. */ - bool CalcLineIntersection(const Vector3d & a_Line1, const Vector3d & a_Line2, double & a_LineCoeff, eBlockFace & a_Face); + Also calculates the distance along the line in which the intersection occurs, and the face hit (BLOCK_FACE_ constants) + Only forward collisions (a_LineCoeff >= 0) are returned. + Exported to Lua manually, because ToLua++ would generate needless input params (a_LineCoeff, a_Face). */ + bool CalcLineIntersection(const Vector3d & a_LinePoint1, const Vector3d & a_LinePoint2, double & a_LineCoeff, eBlockFace & a_Face) const; /** 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) - Only forward collisions (a_LineCoeff >= 0) are returned. */ - static bool CalcLineIntersection(const Vector3d & a_Min, const Vector3d & a_Max, const Vector3d & a_Line1, const Vector3d & a_Line2, double & a_LineCoeff, eBlockFace & a_Face); + Also calculates the distance along the line in which the intersection occurs, and the face hit (BLOCK_FACE_ constants) + Only forward collisions (a_LineCoeff >= 0) are returned. + Exported to Lua manually, because ToLua++ would generate needless input params (a_LineCoeff, a_Face). */ + static bool CalcLineIntersection(const Vector3d & a_Min, const Vector3d & a_Max, const Vector3d & a_LinePoint1, const Vector3d & a_LinePoint2, double & a_LineCoeff, eBlockFace & a_Face); - // tolua_end + /** Calculates the intersection of the two bounding boxes; returns true if nonempty. + Exported manually, because ToLua++ would generate needless input params (a_Intersection). */ + bool Intersect(const cBoundingBox & a_Other, cBoundingBox & a_Intersection) const; - /** Calculates the intersection of the two bounding boxes; returns true if nonempty */ - bool Intersect(const cBoundingBox & a_Other, cBoundingBox & a_Intersection); + // tolua_begin double GetMinX(void) const { return m_Min.x; } double GetMinY(void) const { return m_Min.y; } @@ -89,6 +94,8 @@ public: const Vector3d & GetMin(void) const { return m_Min; } const Vector3d & GetMax(void) const { return m_Max; } + // tolua_end + protected: Vector3d m_Min; Vector3d m_Max; |