summaryrefslogtreecommitdiffstats
path: root/src/Cuboid.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/Cuboid.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/Cuboid.h')
-rw-r--r--src/Cuboid.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Cuboid.h b/src/Cuboid.h
index c205156ec..0e6a37dfb 100644
--- a/src/Cuboid.h
+++ b/src/Cuboid.h
@@ -19,27 +19,27 @@ public:
cCuboid(const Vector3i & a_p1, const Vector3i & a_p2) : p1(a_p1), p2(a_p2) {}
cCuboid(int a_X1, int a_Y1, int a_Z1) : p1(a_X1, a_Y1, a_Z1), p2(a_X1, a_Y1, a_Z1) {}
cCuboid(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2) : p1(a_X1, a_Y1, a_Z1), p2(a_X2, a_Y2, a_Z2) {}
-
+
// tolua_end
-
+
cCuboid & operator =(cCuboid a_Other);
-
+
// tolua_begin
void Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2);
void Assign(const cCuboid & a_SrcCuboid);
void Sort(void);
-
+
int DifX(void) const { return p2.x - p1.x; }
int DifY(void) const { return p2.y - p1.y; }
int DifZ(void) const { return p2.z - p1.z; }
-
+
/** Returns the volume of the cuboid, in blocks.
Note that the volume considers both coords inclusive.
Works on unsorted cuboids, too. */
int GetVolume(void) const;
-
+
/** Returns true if the cuboids have at least one voxel in common. Both coords are considered inclusive.
Assumes both cuboids are sorted. */
bool DoesIntersect(const cCuboid & a_Other) const;
@@ -70,19 +70,19 @@ public:
(v.z >= p1.z) && (v.z <= p2.z)
);
}
-
+
/** Returns true if this cuboid is completely inside the specifie cuboid (in all 6 coords).
Assumes both cuboids are sorted. */
bool IsCompletelyInside(const cCuboid & a_Outer) const;
-
+
/** Moves the cuboid by the specified offsets in each direction */
void Move(int a_OfsX, int a_OfsY, int a_OfsZ);
-
+
/** Expands the cuboid by the specified amount in each direction.
Works on unsorted cuboids as well.
Note that this function doesn't check for underflows when using negative amounts. */
void Expand(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ);
-
+
/** Clamps both X coords to the specified range. Works on unsorted cuboids, too. */
void ClampX(int a_MinX, int a_MaxX);
@@ -94,7 +94,7 @@ public:
/** Returns true if the coords are properly sorted (lesser in p1, greater in p2) */
bool IsSorted(void) const;
-
+
/** If needed, expands the cuboid so that it contains the specified point. Assumes sorted. Doesn't contract. */
void Engulf(const Vector3i & a_Point);
} ;