Struct oxygengine_physics_2d::prelude::ncollide2d::pipeline::object::CollisionObjectUpdateFlags
source · pub struct CollisionObjectUpdateFlags { /* private fields */ }
Expand description
Flags indicating what changed in a collision object since the last collision world update.
Implementations§
source§impl CollisionObjectUpdateFlags
impl CollisionObjectUpdateFlags
sourcepub const POSITION_CHANGED: CollisionObjectUpdateFlags = _
pub const POSITION_CHANGED: CollisionObjectUpdateFlags = _
Indicate that the collision object’s position changed.
sourcepub const PREDICTED_POSITION_CHANGED: CollisionObjectUpdateFlags = _
pub const PREDICTED_POSITION_CHANGED: CollisionObjectUpdateFlags = _
Indicate that the collision object’s predicted position changed.
sourcepub const SHAPE_CHANGED: CollisionObjectUpdateFlags = _
pub const SHAPE_CHANGED: CollisionObjectUpdateFlags = _
Indicate that the collision object’s shape changed.
sourcepub const COLLISION_GROUPS_CHANGED: CollisionObjectUpdateFlags = _
pub const COLLISION_GROUPS_CHANGED: CollisionObjectUpdateFlags = _
Indicate that the collision object’s collision group changed.
sourcepub const QUERY_TYPE_CHANGED: CollisionObjectUpdateFlags = _
pub const QUERY_TYPE_CHANGED: CollisionObjectUpdateFlags = _
Indicate that the collision object’s geometric query type changed.
sourcepub const fn empty() -> CollisionObjectUpdateFlags
pub const fn empty() -> CollisionObjectUpdateFlags
Returns an empty set of flags.
sourcepub const fn all() -> CollisionObjectUpdateFlags
pub const fn all() -> CollisionObjectUpdateFlags
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u8) -> Option<CollisionObjectUpdateFlags>
pub const fn from_bits(bits: u8) -> Option<CollisionObjectUpdateFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u8) -> CollisionObjectUpdateFlags
pub const fn from_bits_truncate(bits: u8) -> CollisionObjectUpdateFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u8) -> CollisionObjectUpdateFlags
pub const unsafe fn from_bits_unchecked(bits: u8) -> CollisionObjectUpdateFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: CollisionObjectUpdateFlags) -> bool
pub const fn intersects(&self, other: CollisionObjectUpdateFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: CollisionObjectUpdateFlags) -> bool
pub const fn contains(&self, other: CollisionObjectUpdateFlags) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: CollisionObjectUpdateFlags)
pub fn insert(&mut self, other: CollisionObjectUpdateFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: CollisionObjectUpdateFlags)
pub fn remove(&mut self, other: CollisionObjectUpdateFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: CollisionObjectUpdateFlags)
pub fn toggle(&mut self, other: CollisionObjectUpdateFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: CollisionObjectUpdateFlags, value: bool)
pub fn set(&mut self, other: CollisionObjectUpdateFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(
self,
other: CollisionObjectUpdateFlags
) -> CollisionObjectUpdateFlags
pub const fn intersection( self, other: CollisionObjectUpdateFlags ) -> CollisionObjectUpdateFlags
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(
self,
other: CollisionObjectUpdateFlags
) -> CollisionObjectUpdateFlags
pub const fn union( self, other: CollisionObjectUpdateFlags ) -> CollisionObjectUpdateFlags
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(
self,
other: CollisionObjectUpdateFlags
) -> CollisionObjectUpdateFlags
pub const fn difference( self, other: CollisionObjectUpdateFlags ) -> CollisionObjectUpdateFlags
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(
self,
other: CollisionObjectUpdateFlags
) -> CollisionObjectUpdateFlags
pub const fn symmetric_difference( self, other: CollisionObjectUpdateFlags ) -> CollisionObjectUpdateFlags
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> CollisionObjectUpdateFlags
pub const fn complement(self) -> CollisionObjectUpdateFlags
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
source§impl CollisionObjectUpdateFlags
impl CollisionObjectUpdateFlags
sourcepub fn needs_broad_phase_update(&self) -> bool
pub fn needs_broad_phase_update(&self) -> bool
Checks if the collision object has been changed in a way that justify a broad-phase update.
sourcepub fn needs_narrow_phase_update(&self) -> bool
pub fn needs_narrow_phase_update(&self) -> bool
Checks if the collision object has been changed in a way that justify a narrow-phase update.
sourcepub fn needs_bounding_volume_update(&self) -> bool
pub fn needs_bounding_volume_update(&self) -> bool
Checks if the collision object has been changed in a way that justify an update of its bounding volume.
sourcepub fn needs_broad_phase_redispatch(&self) -> bool
pub fn needs_broad_phase_redispatch(&self) -> bool
Checks if the collision object has been changed in a way that justify that the broad-phase recompute all potential proximity pairs for this collision objects.
Trait Implementations§
source§impl Binary for CollisionObjectUpdateFlags
impl Binary for CollisionObjectUpdateFlags
source§impl BitAnd<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitAnd<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitand(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
fn bitand(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
Returns the intersection between the two sets of flags.
§type Output = CollisionObjectUpdateFlags
type Output = CollisionObjectUpdateFlags
&
operator.source§impl BitAndAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitAndAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitand_assign(&mut self, other: CollisionObjectUpdateFlags)
fn bitand_assign(&mut self, other: CollisionObjectUpdateFlags)
Disables all flags disabled in the set.
source§impl BitOr<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitOr<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitor(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
fn bitor(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
Returns the union of the two sets of flags.
§type Output = CollisionObjectUpdateFlags
type Output = CollisionObjectUpdateFlags
|
operator.source§impl BitOrAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitOrAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitor_assign(&mut self, other: CollisionObjectUpdateFlags)
fn bitor_assign(&mut self, other: CollisionObjectUpdateFlags)
Adds the set of flags.
source§impl BitXor<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitXor<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitxor(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
fn bitxor(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
Returns the left flags, but with all the right flags toggled.
§type Output = CollisionObjectUpdateFlags
type Output = CollisionObjectUpdateFlags
^
operator.source§impl BitXorAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl BitXorAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn bitxor_assign(&mut self, other: CollisionObjectUpdateFlags)
fn bitxor_assign(&mut self, other: CollisionObjectUpdateFlags)
Toggles the set of flags.
source§impl Clone for CollisionObjectUpdateFlags
impl Clone for CollisionObjectUpdateFlags
source§fn clone(&self) -> CollisionObjectUpdateFlags
fn clone(&self) -> CollisionObjectUpdateFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CollisionObjectUpdateFlags
impl Debug for CollisionObjectUpdateFlags
source§impl Default for CollisionObjectUpdateFlags
impl Default for CollisionObjectUpdateFlags
source§fn default() -> CollisionObjectUpdateFlags
fn default() -> CollisionObjectUpdateFlags
source§impl Extend<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl Extend<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = CollisionObjectUpdateFlags>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = CollisionObjectUpdateFlags>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl FromIterator<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn from_iter<T>(iterator: T) -> CollisionObjectUpdateFlagswhere
T: IntoIterator<Item = CollisionObjectUpdateFlags>,
fn from_iter<T>(iterator: T) -> CollisionObjectUpdateFlagswhere T: IntoIterator<Item = CollisionObjectUpdateFlags>,
source§impl Hash for CollisionObjectUpdateFlags
impl Hash for CollisionObjectUpdateFlags
source§impl Not for CollisionObjectUpdateFlags
impl Not for CollisionObjectUpdateFlags
source§fn not(self) -> CollisionObjectUpdateFlags
fn not(self) -> CollisionObjectUpdateFlags
Returns the complement of this set of flags.
§type Output = CollisionObjectUpdateFlags
type Output = CollisionObjectUpdateFlags
!
operator.source§impl Octal for CollisionObjectUpdateFlags
impl Octal for CollisionObjectUpdateFlags
source§impl Ord for CollisionObjectUpdateFlags
impl Ord for CollisionObjectUpdateFlags
source§fn cmp(&self, other: &CollisionObjectUpdateFlags) -> Ordering
fn cmp(&self, other: &CollisionObjectUpdateFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl PartialEq<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn eq(&self, other: &CollisionObjectUpdateFlags) -> bool
fn eq(&self, other: &CollisionObjectUpdateFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl PartialOrd<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn partial_cmp(&self, other: &CollisionObjectUpdateFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &CollisionObjectUpdateFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl Sub<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn sub(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
fn sub(self, other: CollisionObjectUpdateFlags) -> CollisionObjectUpdateFlags
Returns the set difference of the two sets of flags.
§type Output = CollisionObjectUpdateFlags
type Output = CollisionObjectUpdateFlags
-
operator.source§impl SubAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
impl SubAssign<CollisionObjectUpdateFlags> for CollisionObjectUpdateFlags
source§fn sub_assign(&mut self, other: CollisionObjectUpdateFlags)
fn sub_assign(&mut self, other: CollisionObjectUpdateFlags)
Disables all flags enabled in the set.
impl Copy for CollisionObjectUpdateFlags
impl Eq for CollisionObjectUpdateFlags
impl StructuralEq for CollisionObjectUpdateFlags
impl StructuralPartialEq for CollisionObjectUpdateFlags
Auto Trait Implementations§
impl RefUnwindSafe for CollisionObjectUpdateFlags
impl Send for CollisionObjectUpdateFlags
impl Sync for CollisionObjectUpdateFlags
impl Unpin for CollisionObjectUpdateFlags
impl UnwindSafe for CollisionObjectUpdateFlags
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere T: Default,
fn initialize(&mut self)
§unsafe fn initialize_raw(data: *mut ())
unsafe fn initialize_raw(data: *mut ())
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.