public sealed class PredictionSmootherHides a correction from the eye without hiding it from the simulation.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The simulation takes the correction at once and the picture catches up. That split is the whole idea and it is OwnerSmoothing's, applied per predicted object rather than to one avatar: what the server will judge is already right, and what the player sees glides there over a tenth of a second. Blending the simulation instead would mean the client keeps predicting from a position the server has already disagreed with, which does not converge.
One smoother per object, made on demand and dropped with the object. A single shared error would be wrong the moment two predicted things are corrected differently — which is the normal case for a player and the vehicle they are driving.
Fields and properties (5)
public TimeSpan HalfLifeHow long the visible half of an error takes to disappear.
public float SnapDistanceHow large a correction stops being smoothed and is simply shown.
public int CountHow many objects are being smoothed right now.
public long CorrectionCountCorrections taken.
public long SnapCountCorrections too large to hide, which were shown instead.
Methods (4)
public void Take(IReadOnlyList<PredictionCorrection> corrections)Takes whatever the last reconciliation moved.
public void Advance(TimeSpan elapsed)Moves every offset toward zero.
public Vector3 Draw(NetworkId id, in Vector3 simulated)Where an object should be drawn, given where the simulation says it is.
public bool Forget(NetworkId id)Forgets an object, because it is gone or has been put somewhere.
Used by (3)
- PredictionSmoothingSystemVixen.Net.Engine
- PredictionSmoothingTestsVixen.Net.Engine.Tests
- PredictionWiringTestsVixen.Net.Tests