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 // tolua isn't aware of implicitly generated copy constructors 33 int DifX(
void)
const {
return p2.
x - p1.
x; }
34 int DifY(
void)
const {
return p2.
y - p1.
y; }
35 int DifZ(
void)
const {
return p2.
z - p1.
z; }
63 (v.
x >= p1.
x) && (v.
x <= p2.
x) &&
64 (v.
y >= p1.
y) && (v.
y <= p2.
y) &&
65 (v.
z >= p1.
z) && (v.
z <= p2.
z)
72 (v.
x >= p1.
x) && (v.
x <= p2.
x) &&
73 (v.
y >= p1.
y) && (v.
y <= p2.
y) &&
74 (v.
z >= p1.
z) && (v.
z <= p2.
z)
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);
126 (p1.
x == aOther.
p1.
x) &&
127 (p1.
y == aOther.
p1.
y) &&
128 (p1.
z == aOther.
p1.
z) &&
129 (p2.
x == aOther.
p2.
x) &&
130 (p2.
y == aOther.
p2.
y) &&
131 (p2.
z == aOther.
p2.
z)
150 return ((a_Min1 <= a_Max2) && (a_Max1 >= a_Min2));
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
bool operator!=(const cCuboid &aOther) const
bool operator==(const cCuboid &aOther) const
Checks the two cuboids for equality.
bool DoesIntersect(const cCuboid &a_Other) const
Returns true if the cuboids have at least one voxel in common.
bool IsSorted(void) const
Returns true if the coords are properly sorted (lesser in p1, greater in p2)
cCuboid(int a_X1, int a_Y1, int a_Z1)
void Assign(Vector3i a_Point1, Vector3i a_Point2)
void Clamp(const cCuboid &a_Limits)
Clamps this cuboid, so that it doesn't reach outside of a_Limits in any direction.
void ClampX(int a_MinX, int a_MaxX)
Clamps both X coords to the specified range.
cCuboid(Vector3i a_p1, Vector3i a_p2)
void Assign(const cCuboid &a_SrcCuboid)
int GetVolume(void) const
Returns the volume of the cuboid, in blocks.
void ClampZ(int a_MinZ, int a_MaxZ)
Clamps both Z coords to the specified range.
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 Move(Vector3i a_Offset)
Moves the cuboid by the specified offset.
bool IsCompletelyInside(const cCuboid &a_Outer) const
Returns true if this cuboid is completely inside the specified cuboid (in all 6 coords).
void ClampY(int a_MinY, int a_MaxY)
Clamps both Y coords to the specified range.
bool IsInside(Vector3i v) const
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 Engulf(Vector3i a_Point)
If needed, expands the cuboid so that it contains the specified point.