pub struct FrameInput {
pub player_id: u8,
pub movement: Vec3Fix,
pub actions: u32,
pub aim_direction: Vec3Fix,
}Expand description
Player input for a single simulation frame.
Compact, deterministic representation of all player actions.
Serialized size: ~20 bytes (player_id + movement + actions + aim_yaw).
Fields§
§player_id: u8Player identifier (0-based)
movement: Vec3FixMovement direction (fixed-point, normalized by game logic)
actions: u32Action bitfield (jump=0x1, fire=0x2, interact=0x4, etc.)
aim_direction: Vec3FixAim direction (yaw/pitch encoded as fixed-point)
Implementations§
Source§impl FrameInput
impl FrameInput
Sourcepub const fn with_movement(self, movement: Vec3Fix) -> Self
pub const fn with_movement(self, movement: Vec3Fix) -> Self
Set movement direction
Sourcepub const fn with_actions(self, actions: u32) -> Self
pub const fn with_actions(self, actions: u32) -> Self
Set action bitfield
Sourcepub const fn has_action(&self, bit: u32) -> bool
pub const fn has_action(&self, bit: u32) -> bool
Check if a specific action bit is set
Sourcepub const fn from_bytes(data: &[u8; 20]) -> Self
pub const fn from_bytes(data: &[u8; 20]) -> Self
Deserialize from bytes
Trait Implementations§
Source§impl Clone for FrameInput
impl Clone for FrameInput
impl Copy for FrameInput
Source§impl Debug for FrameInput
impl Debug for FrameInput
impl Eq for FrameInput
Source§impl PartialEq for FrameInput
impl PartialEq for FrameInput
impl StructuralPartialEq for FrameInput
Auto Trait Implementations§
impl Freeze for FrameInput
impl RefUnwindSafe for FrameInput
impl Send for FrameInput
impl Sync for FrameInput
impl Unpin for FrameInput
impl UnsafeUnpin for FrameInput
impl UnwindSafe for FrameInput
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,
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 more