pub trait Collidable {
// Required method
fn bounding_box(&self) -> Aabb;
// Provided method
fn can_collide_with(&self, _other: &dyn Collidable) -> bool { ... }
}Expand description
Trait for objects that can participate in collision detection.
Required Methods§
Sourcefn bounding_box(&self) -> Aabb
fn bounding_box(&self) -> Aabb
Return the axis-aligned bounding box of this object.
Provided Methods§
Sourcefn can_collide_with(&self, _other: &dyn Collidable) -> bool
fn can_collide_with(&self, _other: &dyn Collidable) -> bool
Whether this object can interact with another.