InputCollector

Trait InputCollector 

Source
pub trait InputCollector<'a, State>: Send + Sync {
    // Required methods
    fn apply_inputs(&mut self, world: &World);
    fn advance_frame(&mut self);
    fn get_state(&self) -> State;
}
Expand description

Collects local input state for the network client from the World.

Required Methods§

Source

fn apply_inputs(&mut self, world: &World)

Update the internal state with the World.

This should be called every render frame / cpu cycle after input events.

Source

fn advance_frame(&mut self)

Indicates to the collector that its input has been consumed.

This should be called on frame update when input for this frame has been consumed as opposed to the cpu cycle. In a network session, by the time this is called, the dense input should be sent across the network.

Source

fn get_state(&self) -> State

Get the internally stored input state.

Implementors§