Skip to content

five-on-it / packages/net-client/src/remote-buffer / RemoteBuffer

Class: RemoteBuffer ​

Defined in: packages/net-client/src/remote-buffer.ts:145

Ring of timestamped measurements for one entity.

Constructors ​

Constructor ​

new RemoteBuffer(): RemoteBuffer

Returns ​

RemoteBuffer

Properties ​

way ​

readonly way: SampleWay

Defined in: packages/net-client/src/remote-buffer.ts:164

How the last sample was made (one object, filled on every sample).

Accessors ​

blending ​

Get Signature ​

get blending(): boolean

Defined in: packages/net-client/src/remote-buffer.ts:202

Whether a guess is still being drawn away into what the next snapshot said (BLEND_TICKS). A reading for the debug hooks.

Returns ​

boolean


delayTicks ​

Get Signature ​

get delayTicks(): number

Defined in: packages/net-client/src/remote-buffer.ts:176

How many ticks behind the render tick the entity is drawn now (its tier's delay, slewed in).

Returns ​

number


recordedTick ​

Get Signature ​

get recordedTick(): number | undefined

Defined in: packages/net-client/src/remote-buffer.ts:197

The tick of the newest measurement recorded, or undefined before the first: a sample asked past it is extrapolated (an entity in motion), and held past it by MAX_EXTRAPOLATION_TICKS. A reading for the debug hooks; it changes nothing.

Returns ​

number | undefined


tier ​

Get Signature ​

get tier(): number

Defined in: packages/net-client/src/remote-buffer.ts:167

The tier the entity is sent at, as its last change said.

Returns ​

number

Set Signature ​

set tier(tier): void

Defined in: packages/net-client/src/remote-buffer.ts:171

Parameters ​
tier ​

number

Returns ​

void

Methods ​

push() ​

push(tick, e): void

Defined in: packages/net-client/src/remote-buffer.ts:184

Records a measurement of this entity's pose taken on tick. One not newer than the last is ignored (a measurement comes once; a late one tells nothing new).

Parameters ​

tick ​

number

e ​

EntitySnapshot

Returns ​

void


sample() ​

sample(tick, out?): RemoteSample | undefined

Defined in: packages/net-client/src/remote-buffer.ts:211

The pose at the render tick tick (written into out, a new sample by default), drawn the tier's delay behind it, or undefined while there is nothing to show: no measurement yet, or the tick drawn lies before the first (the pose then is unknown).

Parameters ​

tick ​

number

out? ​

RemoteSample = ...

Returns ​

RemoteSample | undefined