pub struct InputPacket {
pub movement: [f32; 2],
pub camera_yaw: f32,
pub jump: bool,
pub interact: bool,
pub sprint: bool,
pub gather: bool,
pub emit_strength: f32,
pub coherence_target: f32,
pub dt: f32,
pub timestamp: f64,
pub tick: u64,
pub grounded: bool,
}Expand description
Simulation-ready input packet. Single canonical type consumed by CausalComputeKernel, CausalEngineEncoder, and all downstream systems.
Fields§
§movement: [f32; 2]Camera-relative movement in [-1,1]. x=right, y=forward.
camera_yaw: f32Camera yaw in radians, for world-space direction derivation.
jump: bool§interact: bool§sprint: bool§gather: bool§emit_strength: f32Analog primary action strength [0,1].
coherence_target: f32Form coherence target [0,1]. 1.0=Cohere, 0.0=Wave.
dt: f32§timestamp: f64Monotonic seconds since session start.
tick: u64§grounded: boolImplementations§
Source§impl InputPacket
impl InputPacket
Sourcepub fn idle(dt: f32, tick: u64) -> Self
pub fn idle(dt: f32, tick: u64) -> Self
Idle packet with all zeros. For tests and no-input frames.
Sourcepub fn from_frame(
frame: &InputFrame,
camera_yaw: f32,
dt: f32,
timestamp: f64,
tick: u64,
grounded: bool,
coherence_target: f32,
gather: bool,
emit_strength: f32,
) -> Self
pub fn from_frame( frame: &InputFrame, camera_yaw: f32, dt: f32, timestamp: f64, tick: u64, grounded: bool, coherence_target: f32, gather: bool, emit_strength: f32, ) -> Self
Bridge an InputFrame to an InputPacket with additional simulation context.
Sourcepub fn actions_as_u8(&self) -> Vec<u8> ⓘ
pub fn actions_as_u8(&self) -> Vec<u8> ⓘ
Encode active actions as u8 discriminants for Weave serialization.
Sourcepub fn has_movement(&self) -> bool
pub fn has_movement(&self) -> bool
Whether any movement input is present.
Trait Implementations§
Source§impl Clone for InputPacket
impl Clone for InputPacket
Source§fn clone(&self) -> InputPacket
fn clone(&self) -> InputPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InputPacket
impl RefUnwindSafe for InputPacket
impl Send for InputPacket
impl Sync for InputPacket
impl Unpin for InputPacket
impl UnsafeUnpin for InputPacket
impl UnwindSafe for InputPacket
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