Trait collider::inter::Interactivity [] [src]

pub trait Interactivity {
    fn can_interact(&self, other: &Self) -> bool;

    fn group(&self) -> Option<Group> { ... }
    fn interact_groups(&self) -> &'static [Group] { ... }
}

Used to determine which pairs of hitboxes should be checked for collisions and which pairs should be ignored.

Required Methods

Returns true if the pair of hitboxes should be checked for collisions. This method should be commutative. This method should be consistent with group and interact_groups, although possibly more restrictive.

Provided Methods

Returns the group id associated with the hitbox. Default is Some(0).

If None is returned, then no collisions will be reported for this hitbox at all.

Returns a list of groups that this hitbox can interact with. Using large lists of groups may be inefficient. Default is [0].

Implementors