pub struct FirstPersonInput {
pub movement: Vec2,
pub look_delta: Vec2,
pub turn_axis: f32,
pub sprint: bool,
pub jump_pressed: bool,
}Expand description
One fixed tick’s input. Movement/turn axes must be finite and in [-1, 1]. Mouse motion is accumulated displacement, not velocity; never multiply by dt.
Fields§
§movement: Vec2Right/back positive; forward is negative Y. Diagonals are normalized.
look_delta: Vec2Relative logical-window pointer displacement, positive Y looks down.
turn_axis: f32Keyboard yaw axis, positive turns right. This is multiplied by dt.
sprint: boolHeld sprint state.
jump_pressed: boolJump press edge, supplied once per fixed update sequence.
Implementations§
Source§impl FirstPersonInput
impl FirstPersonInput
Sourcepub fn from_actions(input: &Input, actions: FirstPersonActions) -> Self
pub fn from_actions(input: &Input, actions: FirstPersonActions) -> Self
Samples the game’s bindings. The caller consumes Input edges after a tick.
Sourcepub fn from_view(input: InputView<'_>, actions: FirstPersonActions) -> Self
pub fn from_view(input: InputView<'_>, actions: FirstPersonActions) -> Self
Samples a routed view so UI can mask gameplay actions and mouse look.
Trait Implementations§
Source§impl Clone for FirstPersonInput
impl Clone for FirstPersonInput
impl Copy for FirstPersonInput
Source§impl Debug for FirstPersonInput
impl Debug for FirstPersonInput
Auto Trait Implementations§
impl Freeze for FirstPersonInput
impl RefUnwindSafe for FirstPersonInput
impl Send for FirstPersonInput
impl Sync for FirstPersonInput
impl Unpin for FirstPersonInput
impl UnsafeUnpin for FirstPersonInput
impl UnwindSafe for FirstPersonInput
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