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 method in BoundingVolume trait to scale the volume relative to its center #12130

Closed
unknownue opened this issue Feb 26, 2024 · 5 comments
Closed
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@unknownue
Copy link
Contributor

unknownue commented Feb 26, 2024

What problem does this solve or what need does it fill?

The BoundingVolume trait has grow and shrink method to change its size. In some case, it would be more convenient to introduce scale method to do this.

Edit: The term "scale" refers to scale the size of bounding volume for given amount and keeps its center unchanged.

What solution would you like?

Add scale method to BoundingVolume trait and add implementation for Aabb2d, Aabb3d, BoundingCircle, BoundingSphere.

What alternative(s) have you considered?

Do not change BoundingVolume trait but add scale method to each volume instead.

@unknownue unknownue added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Feb 26, 2024
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Math Fundamental domain-agnostic mathematical operations and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Feb 26, 2024
@chompaa
Copy link
Member

chompaa commented Feb 26, 2024

Hi, could I work on this as my first issue?

@unknownue
Copy link
Contributor Author

Hi, could I work on this as my first issue?

Yes

@Jondolf
Copy link
Contributor

Jondolf commented Feb 27, 2024

This actually isn't that trivial in terms of what the scaling should do. It's typically not the same as grow and shrink, as the common use cases (that I have encountered) are quite different. See my comment here: #12142 (comment)

@Jondolf Jondolf removed the D-Trivial Nice and easy! A great choice to get started with Bevy label Feb 27, 2024
@unknownue unknownue changed the title Add scale method to BoundingVolume trait Add method in BoundingVolume trait to scale the volume relative to its center Feb 27, 2024
@unknownue
Copy link
Contributor Author

I further clarify the problem in issue title and description. @Jondolf

github-merge-queue bot pushed a commit that referenced this issue Mar 11, 2024
# Objective

Add a `scale_around_center` method to the `BoundingVolume` trait, as per
#12130.

## Solution

Added `scale_around_center` to the `BoundingVolume` trait, implemented
in `Aabb2d`, `Aabb3d`, `BoundingCircle`, and `BoundingSphere` (with
tests).
@unknownue
Copy link
Contributor Author

Fixed by #12142

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
Projects
None yet
Development

No branches or pull requests

4 participants