-
Notifications
You must be signed in to change notification settings - Fork 20
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
Bounding box types #16
Comments
Yeah, Would it be worth having the notion of axis-alignment in the name of the 2d/3d boxes? I don't know how much people use oriented boxes (as opposed to aabb) and which of the two meanings would come to mind first when reading, say, Box2. I think I'd lean towards min/max for the box representation, but I don't have a strong opinion. |
I'm hardly an expert on the topic, but for reference I present the two common use cases where I use bounding boxes, at least for games:
Fortunately it's trivial to have one representation that provides methods to create it or turn it into other representations. Oriented boxes are More Complicated, you have to store an aabb + a rotation or each of the corner points. |
I'm leaning towards the idea of not including the bounding boxes in mint because they are higher level abstractions, and strictly speaking they are more related to collision detection than vector math. Another library can be based on mint to cover this, plus stuff like rays, frustums, etc |
Fiiiiiine, if you insist. :-P |
Another use case I came across is selecting a rectangular pixel section within an image, not even in the game dev area, rather in the VFX area. Just to let you know, I don't really need the box in mint necessarily. I have settled on the bottomleft origin + unsigned size, which has the benefit that it is impossible to create an invalid box. Using min + max might have performance advantages, but can always turn out to be invalid (min > max). |
Concepts like an axis-aligned bounding box are well understood and used widely. We may consider trying to standardize the simplest forms (Range, Box2, Box3).
Issues:
std::ops::Range
is the way. Apparently, one can use it for floats.cc @nical
The text was updated successfully, but these errors were encountered: