pub struct EntityMovementFlags {
on_ground: bool,
horizontal_collision: bool,
vertical_collision: bool,
vertical_collision_below: bool,
}Expand description
Vanilla collision and ground-contact flags updated by Entity.move.
Fields§
§on_ground: bool§horizontal_collision: bool§vertical_collision: bool§vertical_collision_below: boolImplementations§
Source§impl EntityMovementFlags
impl EntityMovementFlags
Sourcepub fn after_move(
on_ground: bool,
horizontal_collision: bool,
vertical_collision: bool,
requested_delta: DVec3,
) -> Self
pub fn after_move( on_ground: bool, horizontal_collision: bool, vertical_collision: bool, requested_delta: DVec3, ) -> Self
Creates movement flags from a completed movement pass.
Sourcepub fn after_move_with_previous(
previous: Self,
vertical_state_update: EntityVerticalMovementStateUpdate,
on_ground: bool,
horizontal_collision: bool,
vertical_collision: bool,
requested_delta: DVec3,
) -> Self
pub fn after_move_with_previous( previous: Self, vertical_state_update: EntityVerticalMovementStateUpdate, on_ground: bool, horizontal_collision: bool, vertical_collision: bool, requested_delta: DVec3, ) -> Self
Creates movement flags from a completed movement pass while preserving vertical/ground state when vanilla skips that update.
Sourcepub const fn horizontal_collision(self) -> bool
pub const fn horizontal_collision(self) -> bool
Returns true if the last movement was clipped horizontally.
Sourcepub const fn vertical_collision(self) -> bool
pub const fn vertical_collision(self) -> bool
Returns true if the last movement was clipped vertically.
Sourcepub const fn vertical_collision_below(self) -> bool
pub const fn vertical_collision_below(self) -> bool
Returns true if the last vertical collision was below the entity.
Sourcepub const fn with_on_ground(self, on_ground: bool) -> Self
pub const fn with_on_ground(self, on_ground: bool) -> Self
Returns the same flags with a new ground-contact value.
Sourcepub const fn with_horizontal_collision(self, horizontal_collision: bool) -> Self
pub const fn with_horizontal_collision(self, horizontal_collision: bool) -> Self
Returns the same flags with a new horizontal-collision value.
Sourcepub const fn without_collisions(self) -> Self
pub const fn without_collisions(self) -> Self
Returns the same ground state with collision flags cleared.
Trait Implementations§
Source§impl Clone for EntityMovementFlags
impl Clone for EntityMovementFlags
Source§fn clone(&self) -> EntityMovementFlags
fn clone(&self) -> EntityMovementFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EntityMovementFlags
Source§impl Debug for EntityMovementFlags
impl Debug for EntityMovementFlags
Source§impl Default for EntityMovementFlags
impl Default for EntityMovementFlags
impl Eq for EntityMovementFlags
Source§impl PartialEq for EntityMovementFlags
impl PartialEq for EntityMovementFlags
impl StructuralPartialEq for EntityMovementFlags
Auto Trait Implementations§
impl Freeze for EntityMovementFlags
impl RefUnwindSafe for EntityMovementFlags
impl Send for EntityMovementFlags
impl Sync for EntityMovementFlags
impl Unpin for EntityMovementFlags
impl UnsafeUnpin for EntityMovementFlags
impl UnwindSafe for EntityMovementFlags
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>