Struct ncollide2d::broad_phase::BroadPhasePairFilters
source · pub struct BroadPhasePairFilters<N: Real, T> { /* private fields */ }
Expand description
Filters deciding whether a proximity is to be further investigated by the narrow phase or not.
All filters have have to return true
in order to allow a proximity to be further handled.
Implementations§
source§impl<N: Real, T> BroadPhasePairFilters<N, T>
impl<N: Real, T> BroadPhasePairFilters<N, T>
sourcepub fn new() -> BroadPhasePairFilters<N, T>
pub fn new() -> BroadPhasePairFilters<N, T>
Creates a new set of collision filters.
sourcepub fn register_collision_filter(
&mut self,
name: &str,
callback: Box<dyn BroadPhasePairFilter<N, T>>
)
pub fn register_collision_filter(
&mut self,
name: &str,
callback: Box<dyn BroadPhasePairFilter<N, T>>
)
Registers a collision filter.
sourcepub fn unregister_collision_filter(&mut self, name: &str) -> bool
pub fn unregister_collision_filter(&mut self, name: &str) -> bool
Unregisters a collision filter.
Returns true
if the filter was found.
sourcepub fn is_pair_valid(
&self,
b1: &CollisionObject<N, T>,
b2: &CollisionObject<N, T>
) -> bool
pub fn is_pair_valid(
&self,
b1: &CollisionObject<N, T>,
b2: &CollisionObject<N, T>
) -> bool
Tells if the collision between b1
and b2
is to be handled by the narrow-phase.
Auto Trait Implementations§
impl<N, T> !RefUnwindSafe for BroadPhasePairFilters<N, T>
impl<N, T> Send for BroadPhasePairFilters<N, T>
impl<N, T> Sync for BroadPhasePairFilters<N, T>
impl<N, T> Unpin for BroadPhasePairFilters<N, T>
impl<N, T> !UnwindSafe for BroadPhasePairFilters<N, T>
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.