Skip to content

Commit

Permalink
Update docs to reflect that the shallowest and not the deepest penetr… (
Browse files Browse the repository at this point in the history
bevyengine#8473)

# Objective
Update documentation for collide_aabb for multiple sides collisions
behavior
  • Loading branch information
wpederzoli authored Apr 23, 2023
1 parent abf12f3 commit 0a35df1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_sprite/src/collide_aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Collision {
///
/// The return value is the side of `B` that `A` has collided with. [`Collision::Left`] means that
/// `A` collided with `B`'s left side. [`Collision::Top`] means that `A` collided with `B`'s top side.
/// If the collision occurs on multiple sides, the side with the deepest penetration is returned.
/// If the collision occurs on multiple sides, the side with the shallowest penetration is returned.
/// If all sides are involved, [`Collision::Inside`] is returned.
pub fn collide(a_pos: Vec3, a_size: Vec2, b_pos: Vec3, b_size: Vec2) -> Option<Collision> {
let a_min = a_pos.truncate() - a_size / 2.0;
Expand Down

0 comments on commit 0a35df1

Please sign in to comment.