From c2759186c09dc981aa672fecb57cce4aea722ec6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 5 Jun 2016 18:23:16 +0200 Subject: Bindings: Fixed cBoundingBox API. --- src/BoundingBox.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/BoundingBox.h') 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; -- cgit v1.2.3