pub struct StickInput { /* private fields */ }Expand description
A single encoded analog stick input entry from a Mario Kart Wii ghost file.
Each entry records the stick position and for how many consecutive frames it was held. Both axes are encoded in a single byte as 4-bit unsigned values (0–14), then shifted to the signed range −7 to +7 for intuitive use.
Negative x values represent left; positive values represent right.
Negative y values represent down; positive values represent up.
Implementations§
Source§impl StickInput
impl StickInput
Sourcepub fn frame_duration(&self) -> u32
pub fn frame_duration(&self) -> u32
Returns the number of frames this stick position was held.
Sourcepub fn set_frame_duration(&mut self, frame_duration: u32)
pub fn set_frame_duration(&mut self, frame_duration: u32)
Sets the number of frames this stick position was held.
Trait Implementations§
Source§impl Debug for StickInput
impl Debug for StickInput
Source§impl PartialEq<[i8; 2]> for StickInput
Compares a StickInput against a [i8; 2] array of [x, y].
impl PartialEq<[i8; 2]> for StickInput
Compares a StickInput against a [i8; 2] array of [x, y].
Source§impl PartialEq for StickInput
Two StickInput values are equal if their x and y positions match,
regardless of frame duration.
impl PartialEq for StickInput
Two StickInput values are equal if their x and y positions match,
regardless of frame duration.
Source§impl TryFrom<&[u8]> for StickInput
Parses a StickInput from a 2-byte slice.
impl TryFrom<&[u8]> for StickInput
Parses a StickInput from a 2-byte slice.
§Errors
Returns StickInputError::InvalidStickInput if either axis value exceeds 14.