knet.player

class knet.player.Player(tick_rate: int)

Playback system which plays the queued snapshots

feed_snapshot(snapshot: Snapshot)

Feed snapshot into queue.

Parameters:

snapshot (knet.snapshot.Snapshot) – snapshot

get_interpolated_snapshot() Snapshot | None

Get a snapshot which is a result of interpolation.

Returns:

snapshot

Return type:

knet.snapshot.Snapshot

get_interpolation_factor() float

Get interpolation factor between previos and next snapshot.

get_real_time() float

Get real time in seconds.

get_snapshot_queue_size() int

Get snapshot queue size.

Returns:

number of snapshots in queue

Return type:

int

get_tick_id() int

Get tick ID of the next snapshot.

get_tick_time() float

Get time of the next tick in seconds.

update(dt: float)

Advances time.

Parameters:

dt (float) – delta time in seconds