17 cCuboid(
int a_X1,
int a_Y1,
int a_Z1) :
p1(a_X1, a_Y1, a_Z1),
p2(a_X1, a_Y1, a_Z1) {}
19 #ifdef TOLUA_EXPOSITION
95 void Expand(
int a_SubMinX,
int a_AddMaxX,
int a_SubMinY,
int a_AddMaxY,
int a_SubMinZ,
int a_AddMaxZ);
106 void ClampX(
int a_MinX,
int a_MaxX);
109 void ClampY(
int a_MinY,
int a_MaxY);
112 void ClampZ(
int a_MinZ,
int a_MaxZ);
150 return ((a_Min1 <= a_Max2) && (a_Max1 >= a_Min2));
void Expand(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ)
Expands the cuboid by the specified amount in each direction.
void ClampSize(Vector3i a_MaxSize)
Clamps this cuboid's p2 so that the cuboid's size doesn't exceed the specified max size.
bool IsInside(Vector3d v) const
int GetVolume(void) const
Returns the volume of the cuboid, in blocks.
void Assign(const cCuboid &a_SrcCuboid)
bool operator!=(const cCuboid &aOther) const
void Assign(Vector3i a_Point1, Vector3i a_Point2)
void ClampX(int a_MinX, int a_MaxX)
Clamps both X coords to the specified range.
bool IsSorted(void) const
Returns true if the coords are properly sorted (lesser in p1, greater in p2)
bool IsInside(Vector3i v) const
cCuboid(int a_X1, int a_Y1, int a_Z1)
void Clamp(const cCuboid &a_Limits)
Clamps this cuboid, so that it doesn't reach outside of a_Limits in any direction.
void ClampZ(int a_MinZ, int a_MaxZ)
Clamps both Z coords to the specified range.
static bool DoIntervalsIntersect(int a_Min1, int a_Max1, int a_Min2, int a_Max2)
Returns true if the two specified intervals have a non-empty union.
void Move(Vector3i a_Offset)
Moves the cuboid by the specified offset.
cCuboid(Vector3i a_p1, Vector3i a_p2)
void Engulf(Vector3i a_Point)
If needed, expands the cuboid so that it contains the specified point.
bool operator==(const cCuboid &aOther) const
Checks the two cuboids for equality.
bool IsCompletelyInside(const cCuboid &a_Outer) const
Returns true if this cuboid is completely inside the specified cuboid (in all 6 coords).
bool DoesIntersect(const cCuboid &a_Other) const
Returns true if the cuboids have at least one voxel in common.
void ClampY(int a_MinY, int a_MaxY)
Clamps both Y coords to the specified range.