Skip to main content

Collidable

Trait Collidable 

Source
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§

Source

fn bounding_box(&self) -> Aabb

Return the axis-aligned bounding box of this object.

Provided Methods§

Source

fn can_collide_with(&self, _other: &dyn Collidable) -> bool

Whether this object can interact with another.

Implementors§