summaryrefslogtreecommitdiffstats
path: root/src/Cuboid.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-08-09 14:53:57 +0200
committerMattes D <github@xoft.cz>2019-08-10 12:25:06 +0200
commitd0b095ad512959bf15be0f81a972898f5b89099d (patch)
treec8ed92dc28a048e134d3f13b4c215d42dca7b956 /src/Cuboid.h
parentRemoved coord-based API from cCuboid. (#4362) (diff)
downloadcuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar.gz
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar.bz2
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar.lz
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar.xz
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.tar.zst
cuberite-d0b095ad512959bf15be0f81a972898f5b89099d.zip
Diffstat (limited to '')
-rw-r--r--src/Cuboid.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Cuboid.h b/src/Cuboid.h
index 864bea7a2..ed36a2298 100644
--- a/src/Cuboid.h
+++ b/src/Cuboid.h
@@ -94,6 +94,14 @@ public:
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 this cuboid, so that it doesn't reach outside of a_Limits in any direction.
+ Assumes both this and a_Limits are sorted. */
+ void Clamp(const cCuboid & a_Limits);
+
+ /** Clamps this cuboid's p2 so that the cuboid's size doesn't exceed the specified max size.
+ Assumes this cuboid is sorted. */
+ void ClampSize(Vector3i a_MaxSize);
+
/** Clamps both X coords to the specified range. Works on unsorted cuboids, too. */
void ClampX(int a_MinX, int a_MaxX);