Skip to content

Commit c5717b5

Browse files
committed
Document collide args (#2721)
Fixes #2720 (comment) Possibly we should omit the extra bit in brackets, not sure if its warranted.
1 parent 47ccebf commit c5717b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/bevy_sprite/src/collide_aabb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ pub enum Collision {
1212

1313
// TODO: ideally we can remove this once bevy gets a physics system
1414
/// Axis-aligned bounding box collision with "side" detection
15+
/// * a_pos and b_pos are the center positions of the rectangles, typically obtained by extracting the `translation` field from a `Transform` component
16+
/// * a_size and b_size are the dimensions (width and height) of the rectangles.
1517
pub fn collide(a_pos: Vec3, a_size: Vec2, b_pos: Vec3, b_size: Vec2) -> Option<Collision> {
1618
let a_min = a_pos.truncate() - a_size / 2.0;
1719
let a_max = a_pos.truncate() + a_size / 2.0;

0 commit comments

Comments
 (0)