Vixen
02b45cc4
csharp
public sealed class PhysicsDebugDraw

Turns 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 StaticColour

    A static body's colour.

  • public static Color4 KinematicColour

    A kinematic body's colour.

  • public static Color4 AwakeColour

    An awake dynamic body's colour.

  • public static Color4 SleepingColour

    A sleeping dynamic body's colour.

  • public static Color4 SensorColour

    A sensor's colour.

  • public static Color4 ContactColour

    A contact point's colour.

  • public static Color4 ConstraintColour

    A constraint's anchors and axis.

  • public static Color4 ConstraintErrorColour

    The segment between a constraint's two anchors — its unresolved error.

  • public PhysicsDebugOverlay Overlay

    What to draw.

  • public float ContactNormalLength

    How long a contact normal is drawn, in metres.

  • public float ConstraintAnchorSize

    How big a constraint's anchor cross is drawn, in metres.

  • public float ConstraintAxisLength

    How long a constraint's axis is drawn, in metres.

Methods (2)

Used by (1)

  • PhysicsDebugDrawSystemVixen.Physics