public sealed class WaterDebugDrawWhat WaterDebug's five world-space verbs actually draw.
Remarks
[35 § Part 2 § Debugging](../../docs/plan/35-water.md#debugging), and the half that was owed. stat water and stat watermesh needed only numbers somebody already publishes and shipped with the mode; these needed lines, and water had no seam into a viewport line pass. It turns out it did not need one — DebugDraw is exactly that seam, and it is the accumulator rather than the renderer, so this assembly draws into it without knowing what a line pass is.
⚠ Five and not six. water.showBuoyancy lives in Vixen.Water.Physics, because the pontoons and the forces are that assembly's and this one must not reference it — § D1 puts the physics join in its own assembly precisely so that nothing linking Jolt is linked by a renderer. The flag is here because the console verb is; the drawing is where the data is.
⚠ Every draw reads the frame's own answer rather than recomputing one. The patches come from Selected, the surface from the zone's WaterQuery, the window from the field that was rasterised. A debug overlay that descended the quadtree again, or evaluated the waves at its own time, would agree with the frame until the moment it stopped — and that moment is exactly the bug somebody turned the overlay on to find.
Nothing here allocates per line. DebugDraw appends into three lists it owns; what this adds is a bounded walk over the patches a frame actually drew.
Fields and properties (5)
public int GridSamplesHow many samples across a zone's window the flow and info grids take.
public float FlowScaleHow long an arrow one metre a second of flow draws, in metres.
public float LiftHow far above the surface the overlays are lifted, in metres.
public Vector2 ChartOriginWhere the info channels are charted, in pixels from the top-left.
public Vector2 ChartSizeHow large each channel's row is, in pixels.
Methods (3)
public void Draw(DebugDraw into, WaterZoneSystem zones, WaterMeshRenderer? mesh = null, WaterRipples? ripples = null)Draws whichever of the five verbs are switched on.
public void Tiles(DebugDraw into, WaterZoneState state, WaterSurfaceMesh mesh, ReadOnlySpan<TerrainLodNode> selected, int farCount)Draws one zone's patches, coloured by what is under each.
public static void Bands(DebugDraw into, WaterSurfaceMesh mesh, Vector3 eye)The morph bands as rings about the camera — where a pop is diagnosed.
Used by (2)
- WaterDebugDrawTestsVixen.Rendering.Water.Tests
- WaterPresenterVixen.Editor.App