Vixen
c7401864
csharp
public sealed class WaterClockSystem

Advances the one water clock, before anything in the frame reads it.

Read the guide page for this →

As a system

Phase
EarlyUpdate

Remarks

[35 § D2](../../docs/plan/35-water.md#d2-one-evaluator-two-hosts-and-the-seam-is-a-test)'s first consequence, given a phase. There is exactly one water time in a running game: the vertex stage draws at it, the underwater shape tests at it, and a buoyancy solver integrates at it. This is the one thing that writes it.

⚠ In EarlyUpdate, and the phase is the whole point of the system existing. WaterZoneSystem used to advance the clock in its own PreRender update — it has to fold there, because a body is rasterised where TransformSystem has just put it — and FixedUpdate runs earlier in the same frame. So a buoyancy solver read last frame's water time while the vertex stage drew this frame's, and a boat sat exactly one frame of swell behind the water underneath it: constant, small, and invisible until the frame rate changed. Which is the drift § D2's whole seam exists to prevent, arriving through the back door of a phase order.

⚠ GameTime.Total, not a delta this accumulates. A system summing its own deltas drifts from the physics step by exactly the rounding and keeps running while the game is paused. The fixed step's own GameTime carries the frame's total unchanged — see FixedStepAccumulator.StepTime — so a solver and a renderer reading it in different phases of one frame read the same number, which is the property this relies on.

A host that forgets it gets a still sea rather than a subtly wrong one. That is deliberate: the alternative is a fallback advance inside the zone system, which is a second writer, and a second writer is what the rule is against.

Fields and properties (2)

  • public float Rate

    How fast water time runs against game time. One is real time.

  • public float WaterTime

    The last value it wrote.

Methods (2)

Used by (2)

  • AppGraphicsVixen.App.Hosting
  • WaterZoneSystemTestsVixen.Rendering.Water.Tests