diff options
author | madmaxoft <github@xoft.cz> | 2014-03-09 19:54:27 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-09 19:54:27 +0100 |
commit | 8889d3b73347a7cc094a0e233479e96f2bc25a49 (patch) | |
tree | 3cf35e69dcae79e21b27d40c47c3be5df4337b23 /src/Cuboid.cpp | |
parent | cPieceGenerator: New connectors are added to the free pool. (diff) | |
download | cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar.gz cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar.bz2 cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar.lz cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar.xz cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.tar.zst cuberite-8889d3b73347a7cc094a0e233479e96f2bc25a49.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Cuboid.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Cuboid.cpp b/src/Cuboid.cpp index 782837b23..dc8df8500 100644 --- a/src/Cuboid.cpp +++ b/src/Cuboid.cpp @@ -197,3 +197,37 @@ bool cCuboid::IsSorted(void) const + +void cCuboid::Engulf(const Vector3i & a_Point) +{ + if (a_Point.x < p1.x) + { + p1.x = a_Point.x; + } + else if (a_Point.x > p2.x) + { + p2.x = a_Point.x; + } + + if (a_Point.y < p1.y) + { + p1.y = a_Point.y; + } + else if (a_Point.y > p2.y) + { + p2.y = a_Point.y; + } + + if (a_Point.z < p1.z) + { + p1.z = a_Point.z; + } + else if (a_Point.z > p2.z) + { + p2.z = a_Point.z; + } +} + + + + |