pub struct EntityBaseState {Show 24 fields
tick_count: i32,
position: DVec3,
old_position: DVec3,
last_known_position: Option<DVec3>,
last_known_speed: DVec3,
velocity: DVec3,
rotation: (f32, f32),
old_rotation: (f32, f32),
pose: EntityPose,
dimensions: EntityDimensions,
bounding_box: WorldAabb,
movement_flags: EntityMovementFlags,
ground_contact: EntityGroundContact,
movement_progress: EntityMovementProgress,
fire_freeze: EntityFireFreezeState,
in_block_state: Option<BlockStateId>,
fluid_contact: EntityFluidContact,
was_eye_in_water: bool,
piston_movement: EntityPistonMovement,
fall_distance: f64,
stuck_speed_multiplier: DVec3,
no_physics: bool,
needs_velocity_sync: bool,
hurt_marked: bool,
}Expand description
Vanilla Entity movement state stored as one locked snapshot.
Position, velocity, rotation, and ground contact are commonly read together
by physics, saving, and future navigation code. Keeping them in one struct
makes those ownership boundaries explicit while still exposing focused
accessors through EntityBase.
Fields§
§tick_count: i32§position: DVec3§old_position: DVec3§last_known_position: Option<DVec3>§last_known_speed: DVec3§velocity: DVec3§rotation: (f32, f32)§old_rotation: (f32, f32)§pose: EntityPose§dimensions: EntityDimensions§bounding_box: WorldAabb§movement_flags: EntityMovementFlags§ground_contact: EntityGroundContact§movement_progress: EntityMovementProgress§fire_freeze: EntityFireFreezeState§in_block_state: Option<BlockStateId>§fluid_contact: EntityFluidContact§was_eye_in_water: bool§piston_movement: EntityPistonMovement§fall_distance: f64§stuck_speed_multiplier: DVec3§no_physics: bool§needs_velocity_sync: bool§hurt_marked: boolImplementations§
Source§impl EntityBaseState
impl EntityBaseState
Sourcepub fn new(position: DVec3, dimensions: EntityDimensions) -> Self
pub fn new(position: DVec3, dimensions: EntityDimensions) -> Self
Creates base state for a freshly spawned entity.
Sourcepub fn new_with_bounding_box(
position: DVec3,
dimensions: EntityDimensions,
bounding_box: WorldAabb,
) -> Self
pub fn new_with_bounding_box( position: DVec3, dimensions: EntityDimensions, bounding_box: WorldAabb, ) -> Self
Creates base state with an explicit bounding box.
Hanging entities and other special cases do not use the default dimensions-centered box.
fn make_bounding_box(position: DVec3, dimensions: EntityDimensions) -> WorldAabb
Sourcepub fn with_velocity(self, velocity: DVec3) -> Self
pub fn with_velocity(self, velocity: DVec3) -> Self
Sets velocity on this state snapshot.
Sourcepub fn with_old_position(self, old_position: DVec3) -> Self
pub fn with_old_position(self, old_position: DVec3) -> Self
Sets previous position on this state snapshot.
Sourcepub fn with_rotation(self, rotation: (f32, f32)) -> Self
pub fn with_rotation(self, rotation: (f32, f32)) -> Self
Sets rotation on this state snapshot.
Sourcepub const fn with_fall_distance(self, fall_distance: f64) -> Self
pub const fn with_fall_distance(self, fall_distance: f64) -> Self
Sets accumulated fall distance on this state snapshot.
Sourcepub const fn with_fire_freeze_state(
self,
fire_freeze: EntityFireFreezeState,
) -> Self
pub const fn with_fire_freeze_state( self, fire_freeze: EntityFireFreezeState, ) -> Self
Sets base fire/freeze state on this construction snapshot.
Sourcepub const fn with_on_ground(self, on_ground: bool) -> Self
pub const fn with_on_ground(self, on_ground: bool) -> Self
Sets the ground-contact flag on this state snapshot.
Trait Implementations§
Source§impl Clone for EntityBaseState
impl Clone for EntityBaseState
Source§fn clone(&self) -> EntityBaseState
fn clone(&self) -> EntityBaseState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EntityBaseState
Source§impl Debug for EntityBaseState
impl Debug for EntityBaseState
Source§impl PartialEq for EntityBaseState
impl PartialEq for EntityBaseState
impl StructuralPartialEq for EntityBaseState
Auto Trait Implementations§
impl Freeze for EntityBaseState
impl RefUnwindSafe for EntityBaseState
impl Send for EntityBaseState
impl Sync for EntityBaseState
impl Unpin for EntityBaseState
impl UnsafeUnpin for EntityBaseState
impl UnwindSafe for EntityBaseState
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
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> ⓘ
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> ⓘ
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 moreArc<SyncMutex<>>