|
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Go to the documentation of this file.
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
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 Assign(const cCuboid &a_SrcCuboid)
bool IsInside(Vector3d v) const
bool IsSorted(void) const
Returns true if the coords are properly sorted (lesser in p1, greater in p2)
void ClampZ(int a_MinZ, int a_MaxZ)
Clamps both Z coords to the specified range.
cCuboid(int a_X1, int a_Y1, int a_Z1)
bool operator!=(const cCuboid &aOther) 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.
bool operator==(const cCuboid &aOther) const
Checks the two cuboids for equality.
void Engulf(Vector3i a_Point)
If needed, expands the cuboid so that it contains the specified point.
void Clamp(const cCuboid &a_Limits)
Clamps this cuboid, so that it doesn't reach outside of a_Limits in any direction.
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 DoesIntersect(const cCuboid &a_Other) const
Returns true if the cuboids have at least one voxel in common.
cCuboid(Vector3i a_p1, Vector3i a_p2)
bool IsInside(Vector3i v) const
void ClampY(int a_MinY, int a_MaxY)
Clamps both Y coords to the specified range.
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).
int GetVolume(void) const
Returns the volume of the cuboid, in blocks.
void ClampSize(Vector3i a_MaxSize)
Clamps this cuboid's p2 so that the cuboid's size doesn't exceed the specified max size.
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.