pub struct EntityRotationSyncState {
last_body_rotation: PackedEntityRotation,
last_head_yaw: i8,
}Expand description
Last packed rotation values known to tracking clients.
Fields§
§last_body_rotation: PackedEntityRotation§last_head_yaw: i8Implementations§
Source§impl EntityRotationSyncState
impl EntityRotationSyncState
Sourcepub const fn new(body_rotation: (f32, f32), head_yaw: f32) -> Self
pub const fn new(body_rotation: (f32, f32), head_yaw: f32) -> Self
Creates rotation sync state for values already known to tracking clients.
Sourcepub fn record_body_rotation(
&mut self,
rotation: (f32, f32),
) -> Option<PackedEntityRotation>
pub fn record_body_rotation( &mut self, rotation: (f32, f32), ) -> Option<PackedEntityRotation>
Records a body rotation packet if the packed yaw or pitch changed.
Sourcepub fn body_rotation_changed(self, rotation: (f32, f32)) -> bool
pub fn body_rotation_changed(self, rotation: (f32, f32)) -> bool
Returns whether packed body yaw or pitch changed since the last sync.
Sourcepub const fn mark_body_rotation_sent(&mut self, rotation: (f32, f32))
pub const fn mark_body_rotation_sent(&mut self, rotation: (f32, f32))
Marks a body rotation as sent because a full position sync includes it.
Sourcepub const fn record_head_yaw(&mut self, head_yaw: f32) -> Option<i8>
pub const fn record_head_yaw(&mut self, head_yaw: f32) -> Option<i8>
Records a head-rotation packet if the packed yaw changed.
Trait Implementations§
Source§impl Clone for EntityRotationSyncState
impl Clone for EntityRotationSyncState
Source§fn clone(&self) -> EntityRotationSyncState
fn clone(&self) -> EntityRotationSyncState
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 EntityRotationSyncState
Source§impl Debug for EntityRotationSyncState
impl Debug for EntityRotationSyncState
impl Eq for EntityRotationSyncState
Source§impl PartialEq for EntityRotationSyncState
impl PartialEq for EntityRotationSyncState
impl StructuralPartialEq for EntityRotationSyncState
Auto Trait Implementations§
impl Freeze for EntityRotationSyncState
impl RefUnwindSafe for EntityRotationSyncState
impl Send for EntityRotationSyncState
impl Sync for EntityRotationSyncState
impl Unpin for EntityRotationSyncState
impl UnsafeUnpin for EntityRotationSyncState
impl UnwindSafe for EntityRotationSyncState
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<>>