mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
1bc293f33a
# Objective Fixes #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> |
||
---|---|---|
.. | ||
alien_cake_addict.rs | ||
breakout.rs | ||
contributors.rs | ||
game_menu.rs |