summaryrefslogtreecommitdiffstats
path: root/src/Cuboid.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-12 07:39:39 +0100
committermadmaxoft <github@xoft.cz>2014-03-12 07:39:39 +0100
commit3e9f265a368fad0f8097ec68681853e0859ea240 (patch)
treecd24727b0ff02d104eee23f44e92174aec977054 /src/Cuboid.h
parentFixed APIDump (diff)
parentMerge pull request #791 from mc-server/PieceGenerator (diff)
downloadcuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar.gz
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar.bz2
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar.lz
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar.xz
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.tar.zst
cuberite-3e9f265a368fad0f8097ec68681853e0859ea240.zip
Diffstat (limited to '')
-rw-r--r--src/Cuboid.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Cuboid.h b/src/Cuboid.h
index 51ccf799b..b95517f69 100644
--- a/src/Cuboid.h
+++ b/src/Cuboid.h
@@ -34,7 +34,8 @@ public:
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. */
+ /** 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;
bool IsInside(const Vector3i & v) const
@@ -64,7 +65,8 @@ public:
);
}
- /** Returns true if this cuboid is completely inside the specifie cuboid (in all 6 coords) */
+ /** 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 */
@@ -72,7 +74,7 @@ public:
/** 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. */
+ 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. */
@@ -86,6 +88,9 @@ 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);
} ;
// tolua_end