public sealed class PhysicsDebugDrawSystemDraws the scene's colliders and contacts into a DebugDraw.
As a system
- Phase
- PreRender
- Reads
- PhysicsBody
- Runs after
- PhysicsInterpolationSystem
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 OverlayNameThe name the console, the flag and the config all use.
public bool EnabledWhether the overlay is drawn at all.
public PhysicsDebugOverlay OverlayWhat is drawn.
public string NameWhat the console and the toggles call it. Lower case, no spaces.
public OverlayAnchor AnchorWhich corner it is pinned to.
public float WidthHow wide the counts panel is, in pixels.
public SystemAccess AccessWhat this system reads and writes.
Methods (3)
public PhysicsDebugDrawSystem(PhysicsScene scene, DebugDraw draw)Draws the scene's colliders and contacts into a DebugDraw.
public void Draw(OverlaySurface surface, in GameTime time)Draws the counts panel that says what the wireframes are of.
public override JobHandle Update(in SystemContext context, JobHandle dependency)Runs the system.
Used by (5)
- ArenaThirdPersonShooter
- PhysicsSceneTestsVixen.Physics.Tests
- PhysicsSystemsVixen.Physics
- PlayOverlayTestsVixen.Editor.App.Tests
- PlayPhysicsVixen.Editor.App