Vixen
02b45cc4
csharp
public sealed class DebugGeometry

Turns a frame's DebugDraw into the two vertex spans a line pipeline draws.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Split out of DebugDrawRenderer because this half is pure arithmetic over two lists and is worth testing without a device — which is the same reason DrawListBuilder is not part of UiRenderer.

Two buffers, not one. World geometry is drawn with the view-projection and is depth-tested against the scene; screen geometry is drawn with a pixel-to-clip matrix and must never be. They cannot share a draw because they do not share a transform, and that is the whole reason there are exactly two — [13](../../docs/plan/13-diagnostics.md) asks for "one draw call per primitive type per frame", and with everything reduced to lines there are two types: the ones in the world and the ones on the glass.

Fields and properties (3)

  • public ReadOnlySpan<LineVertex> World

    The world-space vertices, two per segment.

  • public ReadOnlySpan<LineVertex> Screen

    The screen-space vertices, two per segment, in pixels with y running down.

  • public int LabelCount

    How many labels the last build turned into strokes.

Methods (2)

  • public void Build(DebugDraw draw, in DebugView view)

    Rebuilds both spans from an accumulator.

  • public void Clear()

    Throws both spans away.

Used by (2)

  • DebugDrawRendererVixen.Engine.Renderer
  • DebugGeometryTestsVixen.Engine.Renderer.Tests