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
fn can_interact(&self, other: &Self) -> bool
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
fn group(&self) -> Option<Group>
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.
fn interact_groups(&self) -> &'static [Group]
Returns a list of groups that this hitbox can interact with.
Using large lists of groups may be inefficient.
Default is [0]
.
Implementors
impl Interactivity for DefaultInteractivity