Fix Rect3i::contains(rect), it was off by one on the upper sides

This commit is contained in:
Marc Gilleron 2021-05-29 23:12:11 +01:00
parent 41990a47dc
commit 63f207b5d5

View File

@ -6,7 +6,6 @@
// TODO Could be renamed to something more sensical, like Box3i
class Rect3i {
public:
Vector3i pos;
Vector3i size;
@ -67,9 +66,9 @@ public:
return other.pos.x >= pos.x &&
other.pos.y >= pos.y &&
other.pos.z >= pos.z &&
other_end.x < end.x &&
other_end.y < end.y &&
other_end.z < end.z;
other_end.x <= end.x &&
other_end.y <= end.y &&
other_end.z <= end.z;
}
String to_string() const {