Skip to content

Add a method to compute a bounding box enclosing a set of points#9630

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
joseph-gio:aabb-enclosing
Aug 31, 2023
Merged

Add a method to compute a bounding box enclosing a set of points#9630
alice-i-cecile merged 8 commits intobevyengine:mainfrom
joseph-gio:aabb-enclosing

Conversation

@joseph-gio
Copy link
Copy Markdown
Member

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.

@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
Copy Markdown
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
Copy Markdown
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.

@joseph-gio
Copy link
Copy Markdown
Member Author

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
@joseph-gio joseph-gio 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 <[email protected]>
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