New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements #4360 #4460
Implements #4360 #4460
Conversation
min < max changed to min <= max, with dim.len2() > 0
Am I missing something or would this mean that only zero-size bounding box is considered valid? Shouldn't it be |
@Darkyenus You're right, it was a typo. Just fixed it. |
Why did you make an exception for at least one axis to be not zero? If a zero volume (3D) is valid and a zero area (2D) is a valid then I guess that a zero length (1D) should be valid as well. |
@xoppa I actually had in mind that none of them are to be considered valid, but I guess that's a mistake. Upon further consideration it could be considered valid indeed. |
@@ -210,7 +210,7 @@ public BoundingBox clr () { | |||
/** Returns whether this bounding box is valid. This means that {@link #max} is greater than or equal to {@link #min}, with {@link #dim} greater than zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should update comment also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done now
Thanks |
Makes BoundingBox compatible with 2D by performing a "greater or equal" comparison between
min
andmax
in BoundingBox#isValid().Naturally, this would cause a BoundingBox with an area of 0 to be considered valid, so a
&& !dim.isZero()
was added to the expression as well in order to prevent that.EDIT: updated the dim size check