pub struct EntityLandingContext {
pub velocity: DVec3,
pub achieved_movement_y: f64,
pub is_living_entity: bool,
pub suppresses_bounce: bool,
pub gravity: f64,
pub air_drag: f64,
}Expand description
Entity facts needed by Block.updateEntityMovementAfterFallOn.
Fields§
§velocity: DVec3Entity velocity before the block landing hook adjusts it (currentMovement in vanilla).
achieved_movement_y: f64Vertical movement actually achieved this tick after collision clipping
is_living_entity: boolWhether the entity uses vanilla living-entity bounce behavior.
suppresses_bounce: boolWhether vanilla bounce behavior should be suppressed.
gravity: f64The gravity applied to the entity.
air_drag: f64The air drag of the entity.
Implementations§
Source§impl EntityLandingContext
impl EntityLandingContext
Sourcepub const fn new(
velocity: DVec3,
achieved_movement_y: f64,
is_living_entity: bool,
suppresses_bounce: bool,
gravity: f64,
air_drag: f64,
) -> Self
pub const fn new( velocity: DVec3, achieved_movement_y: f64, is_living_entity: bool, suppresses_bounce: bool, gravity: f64, air_drag: f64, ) -> Self
Creates a landing context for a vertical movement collision.
Sourcepub const fn default_velocity_after_fall_on(self) -> DVec3
pub const fn default_velocity_after_fall_on(self) -> DVec3
Vanilla default Block.updateEntityMovementAfterFallOn result.
Sourcepub fn velocity_after_bounce(&self, restitution: f32) -> DVec3
pub fn velocity_after_bounce(&self, restitution: f32) -> DVec3
Computes the Y velocity after bouncing on a block. doesn’t test if the bounce is valid
Trait Implementations§
Source§impl Clone for EntityLandingContext
impl Clone for EntityLandingContext
impl Copy for EntityLandingContext
Source§impl Debug for EntityLandingContext
impl Debug for EntityLandingContext
Source§impl PartialEq for EntityLandingContext
impl PartialEq for EntityLandingContext
impl StructuralPartialEq for EntityLandingContext
Auto Trait Implementations§
impl Freeze for EntityLandingContext
impl RefUnwindSafe for EntityLandingContext
impl Send for EntityLandingContext
impl Sync for EntityLandingContext
impl Unpin for EntityLandingContext
impl UnsafeUnpin for EntityLandingContext
impl UnwindSafe for EntityLandingContext
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<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<>>