public sealed class PhysicsDebugDrawTurns a PhysicsWorld into lines in a DebugDraw.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Drawn from Vixen's own shape descriptions, not from Jolt's debug renderer. Jolt has one, and using it would mean implementing a native renderer interface whose callbacks arrive as triangles — for geometry whose whole purpose is to be lines. Every shape the registry holds is already described exactly, so a box is its twelve edges and a capsule is its rings, drawn straight into the accumulator every other subsystem uses.
The exception is a mesh or a convex hull, which is drawn as its bounding box. Wireframing a hundred-thousand-triangle level would produce more lines than the debug renderer can hold and would tell nobody anything; the bounds answer the question that is actually being asked, which is "is this body where I think it is".
Colour carries the state. Asleep is grey, static is dark green, kinematic is blue, awake and dynamic is bright green, and a sensor is yellow. That mapping is what makes "the crate has gone to sleep" and "the crate is static" — which look identical in every other respect — tell themselves apart at a glance.
Fields and properties (12)
public static Color4 StaticColourA static body's colour.
public static Color4 KinematicColourA kinematic body's colour.
public static Color4 AwakeColourAn awake dynamic body's colour.
public static Color4 SleepingColourA sleeping dynamic body's colour.
public static Color4 SensorColourA sensor's colour.
public static Color4 ContactColourA contact point's colour.
public static Color4 ConstraintColourA constraint's anchors and axis.
public static Color4 ConstraintErrorColourThe segment between a constraint's two anchors — its unresolved error.
public PhysicsDebugOverlay OverlayWhat to draw.
public float ContactNormalLengthHow long a contact normal is drawn, in metres.
public float ConstraintAnchorSizeHow big a constraint's anchor cross is drawn, in metres.
public float ConstraintAxisLengthHow long a constraint's axis is drawn, in metres.
Methods (2)
public void Draw(PhysicsWorld world, DebugDraw draw, ReadOnlySpan<BodyHandle> bodies)Draws a world's bodies and last-step contacts.
public static void DrawShape(PhysicsShapes shapes, ShapeId shape, Vector3 position, Quaternion rotation, Color4 colour, DebugDraw draw)Draws one registered shape as a wireframe at a pose.
Used by (1)
- PhysicsDebugDrawSystemVixen.Physics