public sealed class PredictedPlayerMovementOne tick of a player's movement, as the predictor replays it.
Remarks
This is the whole of P3's new simulation code, and it is deliberately thin. It writes the tick's input onto the pawn and steps the physics scene — which runs CharacterMotion, the pure rule Vixen.Physics already had and already tested with no Jolt at all. Prediction did not need a second movement implementation, and a framework that made you write one would be a framework whose replay and whose live simulation could disagree.
Why it lives here and not in Vixen.Net.Engine. It is the only type that has to see both a PhysicsScene and a Tick, and neither Vixen.Net nor Vixen.Physics may reference the other — the same reason Vixen.Net.Physics exists at all, applied one layer up.
⚠ It requires PhysicsScene to adopt a written transform. A rollback restores the pawn's LocalTransform from the server's snapshot; a CharacterController's position lives in Jolt and is not restored by anything the ECS does. Without the adopt, every replay would start from the guess it was correcting and the correction would never converge — the failure ClientPrediction's own remarks describe as "correcting the present directly", arrived at from the other end.
Fields and properties (4)
public Entity ControllerThe player whose input this applies. Usually LocalPlayerSystem.Controller.
public Entity PawnThe pawn this client's input drives, or Null.
public long StepCountHow many ticks have been simulated through this, replays included.
public NetworkTransformCaptureSystem TransformsWhat copies the stepped transforms into the ones prediction compares.
Methods (4)
public PredictedPlayerMovement(PhysicsScene scene, float fixedStep)One tick of a player's movement, as the predictor replays it.
public Entity PawnIn(World world)What the tick will actually write its intent onto.
public PredictedStep<PlayerMoveInput> AsStep()The delegate ClientPrediction takes.
public void Step(World world, Tick tick, in PlayerMoveInput input)Advances the world by one tick with one player's input.
Used by (2)
- MachineVixen.Net.Physics.Tests
- PredictedPlayerMovementTestsVixen.Net.Physics.Tests