logo
pub fn collide(
    a_pos: Vec3,
    a_size: Vec2,
    b_pos: Vec3,
    b_size: Vec2
) -> Option<Collision>
Expand description

Axis-aligned bounding box collision with “side” detection

  • a_pos and b_pos are the center positions of the rectangles, typically obtained by extracting the translation field from a Transform component
  • a_size and b_size are the dimensions (width and height) of the rectangles.