public sealed class SnapshotBufferThe last few places something was, and where it therefore is now.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A client draws the world behind the server, not at it: at TickManager.InterpolationTick, far enough back that the snapshots bracketing the moment being drawn have already arrived. That is what makes motion smooth on a connection that delivers in bursts — the buffer is the delay, and the delay is what buys the interpolation something to interpolate between.
Rotation is held rather than extrapolated. A position that overshoots comes back with the next snapshot and reads as momentum; a rotation that overshoots reads as a stumble, and there is no rotational equivalent of the position's constant velocity that is worth assuming.
Fields and properties (10)
public SnapshotBufferOptions OptionsHow it behaves when it runs out.
public int CountHow many samples are held.
public int CapacityHow many it can hold before the oldest goes.
public long StaleCountSamples ignored because something newer had already arrived.
public long InterpolatedCountTimes a value was interpolated between two samples, which is the ordinary case.
public long ExtrapolatedCountTimes motion past the newest sample had to be guessed at.
public long SnappedCountTimes two samples were too far apart to move between, so the object jumped.
public long StarvedCountTimes there was nothing to work with and the newest or oldest was held.
public TransformSample NewestThe newest sample held.
public TransformSample OldestThe oldest sample held.
Methods (4)
public SnapshotBuffer(int capacity = 32, SnapshotBufferOptions? options = null)Creates a buffer.
public bool Add(in TransformSample sample)Takes a sample.
public void Clear()Forgets everything, for an object that has just been spawned again.
public bool TrySample(Tick tick, float fraction, out TransformSample sample)Works out where the thing is at a moment between ticks.
Used by (2)
- GameClientMultiplayer
- MotionTestsVixen.Net.Tests