Vixen
02b45cc4
csharp
public static class CharacterMotion

Turns a character's intent into the velocity its controller is asked to move by.

Read the guide page for this →

Remarks

A pure function, and that is the requirement rather than the style. Everything it reads is an argument and everything it changes is the state it is handed; it touches no clock, no random source and no field of its own. That is what [16](../../../docs/plan/16-networking.md)'s PredictedStep demands — the same tick is simulated twice whenever a snapshot disagrees, and a step that is not reproducible does not merely predict badly, it makes the correction itself wrong. It is also why this is a static class beside the bridge rather than a method on it: a rule that cannot reach a field cannot accidentally depend on one.

It knows nothing about Jolt. The sweep, the stairs and the slope cancellation are the CharacterController's; this decides only what the character is trying to do. So every rule below is testable with no native library, on any runner, which is what makes the determinism assertion cheap enough to run everywhere.

Methods (4)

Used by (3)

  • CharacterAllocationTestsVixen.Physics.Tests
  • CharacterMotionTestsVixen.Physics.Tests
  • PhysicsSceneVixen.Physics