Struct bevy_rapier2d::prelude::InteractionGroups[][src]

#[repr(C)]
pub struct InteractionGroups { pub memberships: u32, pub filter: u32, }
Expand description

Pairwise filtering using bit masks.

This filtering method is based on two 32-bit values:

  • The interaction groups memberships.
  • The interaction groups filter.

An interaction is allowed between two filters a and b when two conditions are met simultaneously:

  • The groups membership of a has at least one bit set to 1 in common with the groups filter of b.
  • The groups membership of b has at least one bit set to 1 in common with the groups filter of a.

In other words, interactions are allowed between two filter iff. the following condition is met:

(self.memberships & rhs.filter) != 0 && (rhs.memberships & self.filter) != 0

Fields

memberships: u32

Groups memberships.

filter: u32

Groups filter.

Implementations

Initializes with the given interaction groups and interaction mask.

Allow interaction with everything.

Prevent all interactions.

Sets the group this filter is part of.

Sets the interaction mask of this filter.

Check if interactions should be allowed based on the interaction memberships and filter.

An interaction is allowed iff. the memberships of self contain at least one bit set to 1 in common with the filter of rhs, and vice-versa.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Creates Self using data from the given [World]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.

Tests if Self the same as the type T Read more

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.