Update docs to reflect that the shallowest and not the deepest penetr… (#8473)
# Objective Update documentation for collide_aabb for multiple sides collisions behavior
This commit is contained in:
parent
abf12f3b3b
commit
0a35df13c9
@ -19,7 +19,7 @@ pub enum Collision {
|
|||||||
///
|
///
|
||||||
/// The return value is the side of `B` that `A` has collided with. [`Collision::Left`] means that
|
/// 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.
|
/// `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.
|
/// 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> {
|
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;
|
let a_min = a_pos.truncate() - a_size / 2.0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user