Skip to content

Commit

Permalink
Document collide args
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Aug 24, 2021
1 parent 958f8b1 commit 2d7bd41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_sprite/src/collide_aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub enum Collision {

// TODO: ideally we can remove this once bevy gets a physics system
/// Axis-aligned bounding box collision with "side" detection
/// * a_pos and b_pos are the center position of the rectangles. (this is different to traditional AABB where the position is the corner)
/// * a_size and b_size are the width and height of the rectangles.
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_max = a_pos.truncate() + a_size / 2.0;
Expand Down

0 comments on commit 2d7bd41

Please sign in to comment.