-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use IntersectsVolume
for breakout example collisions
#11500
Merged
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
Jondolf
added
C-Examples
An addition or correction to our examples
C-Code-Quality
A section of code that is hard to understand or change
A-Physics
Collisions, kinematics, forces and more
labels
Jan 23, 2024
rparrett
changed the title
Use Aabb2d::intersects for breakout example collisions
Use Jan 24, 2024
Aabb2d::intersects
for breakout example collisions
rparrett
changed the title
Use
Use Jan 24, 2024
Aabb2d::intersects
for breakout example collisionsIntersectsVolume
for breakout example collisions
IQuick143
reviewed
Jan 24, 2024
Co-authored-by: IQuick 143 <IQuick143cz@gmail.com>
Co-authored-by: IQuick 143 <IQuick143cz@gmail.com>
Jondolf
approved these changes
Jan 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me! A couple of simple comments on the collision function could be nice especially since this is an example, but it's quite understandable either way so it's non-blocking
IQuick143
approved these changes
Jan 25, 2024
rparrett
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
Jan 25, 2024
alice-i-cecile
added
the
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
label
Jan 28, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 29, 2024
41 tasks
tjamaan
pushed a commit
to tjamaan/bevy
that referenced
this pull request
Feb 6, 2024
) # Objective Fixes bevyengine#11479 ## Solution - Remove `collide_aabb.rs` - Re-implement the example-specific collision code in the example, taking advantage of the new `IntersectsVolume` trait. ## Changelog - Removed `sprite::collide_aabb::collide` and `sprite::collide_aabb::Collision`. ## Migration Guide `sprite::collide_aabb::collide` and `sprite::collide_aabb::Collision` were removed. ```rust // Before let collision = bevy::sprite::collide_aabb::collide(a_pos, a_size, b_pos, b_size); if collision.is_some() { // ... } // After let collision = Aabb2d::new(a_pos.truncate(), a_size / 2.) .intersects(&Aabb2d::new(b_pos.truncate(), b_size / 2.)); if collision { // ... } ``` If you were making use `collide_aabb::Collision`, see the new `collide_with_side` function in the [`breakout` example](https://bevyengine.org/examples/Games/breakout/). ## Discussion As discussed in the linked issue, maybe we want to wait on `bevy_sprite` generally making use of `Aabb2b` so users don't need to construct it manually. But since they **do** need to construct the bounding circle for the ball manually, this doesn't seem like a big deal to me. --------- Co-authored-by: IQuick 143 <IQuick143cz@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Physics
Collisions, kinematics, forces and more
C-Code-Quality
A section of code that is hard to understand or change
C-Examples
An addition or correction to our examples
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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.
Objective
Fixes #11479
Solution
collide_aabb.rs
IntersectsVolume
trait.Changelog
sprite::collide_aabb::collide
andsprite::collide_aabb::Collision
.Migration Guide
sprite::collide_aabb::collide
andsprite::collide_aabb::Collision
were removed.If you were making use
collide_aabb::Collision
, see the newcollide_with_side
function in thebreakout
example.Discussion
As discussed in the linked issue, maybe we want to wait on
bevy_sprite
generally making use ofAabb2b
so users don't need to construct it manually. But since they do need to construct the bounding circle for the ball manually, this doesn't seem like a big deal to me.