public struct PredictionSmoothingHides a rollback by letting an entity's visuals lag the body they hang from.
Remarks
On a child, and that is the whole of the design. A correction moves the predicted body at once, because the simulation has to be right; what a player sees may lag and catch up. So the offset goes on a visual child — the mesh, the skeleton root — which the transform hierarchy composes and which nothing simulates. Unreal does exactly this in SmoothClientPosition: it offsets the mesh component and never the capsule.
⚠ Writing the offset onto the body instead would feed it back into the simulation. PhysicsScene adopts a written LocalTransform as a teleport — that is what makes a rollback reach a CharacterController at all — so a smoothed body position would be taken as the truth on the next fixed step, and the error the smoothing was hiding would become an error the simulation had made. The correction would then never settle.
Not [DataContract], because it names an entity. A prefab therefore carries the mesh as a child and something running in the world says which body it belongs to — the line CameraTargets and Possessing are already on.
Fields and properties (2)
Methods (1)
public static PredictionSmoothing Of(Entity body)Visuals that sit on their body, smoothed when it is corrected.
Used by (2)
- PredictionSmoothingSystemVixen.Net.Engine
- PredictionSmoothingTestsVixen.Net.Engine.Tests