pub struct MovementData {
pub velocity: WorldCoordinate,
pub acceleration: WorldCoordinate,
pub timestamp_ms: u64,
}Expand description
Movement data for player position prediction.
Fields§
§velocity: WorldCoordinateCurrent velocity
acceleration: WorldCoordinateAcceleration
timestamp_ms: u64Timestamp of this movement data
Implementations§
Source§impl MovementData
impl MovementData
Sourcepub fn predict_position(
&self,
current_pos: WorldCoordinate,
delta_ms: u64,
) -> WorldCoordinate
pub fn predict_position( &self, current_pos: WorldCoordinate, delta_ms: u64, ) -> WorldCoordinate
Predicts position after the given time delta.
Trait Implementations§
Source§impl Clone for MovementData
impl Clone for MovementData
Source§fn clone(&self) -> MovementData
fn clone(&self) -> MovementData
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 MovementData
Source§impl Debug for MovementData
impl Debug for MovementData
Source§impl Default for MovementData
impl Default for MovementData
Source§fn default() -> MovementData
fn default() -> MovementData
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MovementData
impl<'de> Deserialize<'de> for MovementData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MovementData
impl RefUnwindSafe for MovementData
impl Send for MovementData
impl Sync for MovementData
impl Unpin for MovementData
impl UnsafeUnpin for MovementData
impl UnwindSafe for MovementData
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