13 m_Min(a_MinX, a_MinY, a_MinZ),
14 m_Max(a_MaxX, a_MaxY, a_MaxZ)
33 m_Min(a_Pos.x - a_Radius, a_Pos.y, a_Pos.z - a_Radius),
34 m_Max(a_Pos.x + a_Radius, a_Pos.y + a_Height, a_Pos.z + a_Radius)
43 m_Min(a_Pos.x - a_Radius, a_Pos.y + a_VerticalOffset, a_Pos.z - a_Radius),
44 m_Max(a_Pos.x + a_Radius, a_Pos.y + a_VerticalOffset + a_Height, a_Pos.z + a_Radius)
53 m_Min(a_Pos.x - a_CubeLength / 2, a_Pos.y - a_CubeLength / 2, a_Pos.z - a_CubeLength / 2),
54 m_Max(a_Pos.x + a_CubeLength / 2, a_Pos.y + a_CubeLength / 2, a_Pos.z + a_CubeLength / 2)
174 ((a_Point.
x >= a_Min.
x) && (a_Point.
x <= a_Max.
x)) &&
175 ((a_Point.
y >= a_Min.
y) && (a_Point.
y <= a_Max.
y)) &&
176 ((a_Point.
z >= a_Min.
z) && (a_Point.
z <= a_Max.
z))
187 ((a_X >= a_Min.
x) && (a_X <= a_Max.
x)) &&
188 ((a_Y >= a_Min.
y) && (a_Y <= a_Max.
y)) &&
189 ((a_Z >= a_Min.
z) && (a_Z <= a_Max.
z))
208 if (
IsInside(a_Min, a_Max, a_Line1))
221 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
227 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
233 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
239 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
245 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
251 if ((c >= 0) && (c < Coeff) &&
IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
288 return (a_Intersection.
m_Min.
z < a_Intersection.
m_Max.
z);
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
Represents two sets of coords, minimum and maximum for each direction.
bool IsInside(Vector3d a_Point)
Returns true if the point is inside the bounding box.
void Move(double a_OffX, double a_OffY, double a_OffZ)
Moves the entire boundingbox by the specified offset.
bool DoesIntersect(const cBoundingBox &a_Other)
Returns true if the two bounding boxes intersect.
cBoundingBox(double a_MinX, double a_MaxX, double a_MinY, double a_MaxY, double a_MinZ, double a_MaxZ)
bool Intersect(const cBoundingBox &a_Other, cBoundingBox &a_Intersection) const
Calculates the intersection of the two bounding boxes; returns true if nonempty.
bool CalcLineIntersection(Vector3d a_LinePoint1, Vector3d a_LinePoint2, double &a_LineCoeff, eBlockFace &a_Face) const
Returns true if this bounding box is intersected by the line specified by its two points Also calcula...
void Expand(double a_ExpandX, double a_ExpandY, double a_ExpandZ)
Expands the bounding box by the specified amount in each direction (so the box becomes larger by 2 * ...
cBoundingBox Union(const cBoundingBox &a_Other)
Returns the union of the two bounding boxes.
double LineCoeffToXZPlane(const Vector3< T > &a_OtherEnd, T a_Y) const
Returns the coefficient for the (a_OtherEnd - this) line to reach the specified Y coord.
static const double NO_INTERSECTION
Return value of LineCoeffToPlane() if the line is parallel to the plane.
double LineCoeffToYZPlane(const Vector3< T > &a_OtherEnd, T a_X) const
Returns the coefficient for the (a_OtherEnd - this) line to reach the specified X coord.
double LineCoeffToXYPlane(const Vector3< T > &a_OtherEnd, T a_Z) const
Returns the coefficient for the (a_OtherEnd - this) line to reach the specified Z coord.