-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add 2D axis-aligned bounding box type #259
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Like graphene_box_t, but for 2D areas. It's more efficient than rectangles, at the cost of legibility.
Pack the minimum and maximum vertices into a single vector, and use merge low/high operators to extract the values. This reduces the size of a box2d instance, and makes it more compact. It's also more efficient to extract both vertices when passing them to GL, by using a single read.
If we want to just know if two boxes intersect each other, we can do that with an inlined function. It's not the fastest possible function, because it still requires calling into graphene_box2d_get_minmax(), as the calling code does not have access to the private fields of the graphene_box2d_t type.
Equivalent of graphene_rect_scale() and graphene_rect_offset_r(), but in a single operation. Scale and offset parameters are optional, so it's easy to use for separate transformations as well.
Check that rectangles roundtrip between 2D boxes, and that the transformation works.
GTK-doc gets very confused by static inlines, so we are going to need to add a non-inline stub and use a macro to rename the inline function in the header.
Meson's gnome.gtkdoc() can generate a test target that will run gtkdoc-check, to verify that all the symbols are properly documented.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Works like
graphene_box_t
, but in two dimensions.Fixes: #204