Skip to content
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 a method to compute a bounding box enclosing a set of points #9630

Merged
merged 8 commits into from
Aug 31, 2023

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Aug 29, 2023

Objective

Make it easier to create bounding boxes in user code by providing a constructor that computes a box surrounding an arbitrary number of points.

Solution

Add Aabb::enclosing, which accepts iterators, slices, or arrays.

JoJoJet and others added 2 commits August 29, 2023 16:06
Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Math Fundamental domain-agnostic mathematical operations labels Aug 29, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful method, but this should have a moderately robust set of tests.

@superdump
Copy link
Contributor

This is implemented on Mesh

/// Compute the Axis-Aligned Bounding Box of the mesh vertices in model space
but Mesh should probably use this code on Aabb once it has been implemented. I think that should be part of this PR.

@JoJoJet
Copy link
Member Author

JoJoJet commented Aug 30, 2023

I've rewritten the Mesh method and added a unit test. Let me know if there's any other test cases that should be covered.

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 30, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 31, 2023
Merged via the queue into bevyengine:main with commit 23598d7 Aug 31, 2023
22 checks passed
@JoJoJet JoJoJet deleted the aabb-enclosing branch August 31, 2023 12:57
@cart cart mentioned this pull request Oct 13, 2023
43 tasks
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
…yengine#9630)

# Objective

Make it easier to create bounding boxes in user code by providing a
constructor that computes a box surrounding an arbitrary number of
points.

## Solution

Add `Aabb::enclosing`, which accepts iterators, slices, or arrays.

---------

Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants