Struct rapier3d_f64::geometry::InteractionGroups [−][src]
Pairwise filtering using bit masks.
This filtering method is based on two 16-bit values:
- The interaction groups (the 16 left-most bits of
self.0
). - The interaction mask (the 16 right-most bits of
self.0
).
An interaction is allowed between two filters a
and b
when two conditions
are met simultaneously:
- The interaction groups of
a
has at least one bit set to1
in common with the interaction mask ofb
. - The interaction groups of
b
has at least one bit set to1
in common with the interaction mask ofa
.
In other words, interactions are allowed between two filter iff. the following condition is met:
((self.0 >> 16) & rhs.0) != 0 && ((rhs.0 >> 16) & self.0) != 0
Implementations
impl InteractionGroups
[src]
pub const fn new(groups: u16, masks: u16) -> Self
[src]
Initializes with the given interaction groups and interaction mask.
pub const fn all() -> Self
[src]
Allow interaction with everything.
pub const fn none() -> Self
[src]
Prevent all interactions.
pub const fn with_groups(self, groups: u16) -> Self
[src]
Sets the group this filter is part of.
pub const fn with_mask(self, mask: u16) -> Self
[src]
Sets the interaction mask of this filter.
pub const fn test(self, rhs: Self) -> bool
[src]
Check if interactions should be allowed based on the interaction groups and mask.
An interaction is allowed iff. the groups of self
contain at least one bit set to 1 in common
with the mask of rhs
, and vice-versa.
Trait Implementations
impl Clone for InteractionGroups
[src]
fn clone(&self) -> InteractionGroups
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for InteractionGroups
[src]
impl Debug for InteractionGroups
[src]
impl Default for InteractionGroups
[src]
impl Eq for InteractionGroups
[src]
impl Hash for InteractionGroups
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<InteractionGroups> for InteractionGroups
[src]
fn eq(&self, other: &InteractionGroups) -> bool
[src]
fn ne(&self, other: &InteractionGroups) -> bool
[src]
impl StructuralEq for InteractionGroups
[src]
impl StructuralPartialEq for InteractionGroups
[src]
Auto Trait Implementations
impl RefUnwindSafe for InteractionGroups
impl Send for InteractionGroups
impl Sync for InteractionGroups
impl Unpin for InteractionGroups
impl UnwindSafe for InteractionGroups
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,