Vixen
dd8b0a81
csharp
public sealed class PhysicsDebugDrawSystem

Draws the scene's colliders and contacts into a DebugDraw.

Read the guide page for this →

As a system

Phase
PreRender

Remarks

In PreRender and after the interpolation pass, so a collider is drawn where the body is rather than where the smoothed transform says — which is the whole point of a physics overlay. The two disagree by up to one step, and when they do, the one being investigated is the body.

Off by default. The overlay is a few thousand lines for a modest scene and there is no cost at all to a system whose Enabled is .

⚠ An IDiagnosticOverlay as well as a system, and that is what makes it reachable. The geometry is world-space and so cannot come out of Draw — which is why this is a system in the first place — but a system has no name, and every other overlay is turned on by one: overlay physics on in the console, --vixen-overlay physics on the command line, AppConfig.EnabledOverlays in a head. Answering to both means the one Enabled flag is what the console writes and what Update reads, rather than a second flag to keep in step.

⚠ Wire it with AddPhysicsOverlay. For a long time everything below this line was written, tested and added by nothing outside one test — the overlay doc 13 § Diagnostic overlays asks for existed and no build could switch it on.

Fields and properties (7)

  • public const string OverlayName

    The name the console, the flag and the config all use.

  • public bool Enabled

    Whether the overlay is drawn at all.

  • public PhysicsDebugOverlay Overlay

    What is drawn.

  • public string Name

    What the console and the toggles call it. Lower case, no spaces.

  • public OverlayAnchor Anchor

    Which corner it is pinned to.

  • public float Width

    How wide the counts panel is, in pixels.

  • public SystemAccess Access

    What this system reads and writes.

Methods (3)

Used by (5)

  • ArenaThirdPersonShooter
  • PhysicsSceneTestsVixen.Physics.Tests
  • PhysicsSystemsVixen.Physics
  • PlayOverlayTestsVixen.Editor.App.Tests
  • PlayPhysicsVixen.Editor.App