Table of Contents

Jolt Debug Visualizations

To debug physics issues it can be very valuable to visualize certain aspects of the Jolt simulation. Debug visualizations are enabled through CVars.

Jolt Geometry

Visualize Jolt Geometry

These CVars enable rendering of the Jolt collision geometry:

  • Jolt.Visualize.Geometry: Enables visualization of physics collision geometry.
  • Jolt.Visualize.Exclusive: Disables rendering of regular geometry.
  • Jolt.Visualize.Distance: Configures the distance up to which Jolt geomtry gets extracted from objects.

The collision geometry is rendered using these color codes:

Color coding

Visualize Jolt Surfaces

  • Jolt.Visualize.Surfaces: Enables visualization of physics collision geometry, color coded by the surface that is assigned to it.

Jolt Surfaces

The same geometry as with Jolt.Visualize.Geometry is rendered, but instead of using the shape type for the color, the geometry uses the Debug Color that is configured on its surface asset. Geometry without an assigned surface is rendered in grey.

Since the colors are freely chosen in the surface assets, it is up to you to pick colors that are easy to tell apart.

Both visualizations render the same geometry, so only one of them is active at a time. If both CVars are enabled, Jolt.Visualize.Surfaces wins.

Debug Draw Constraints

The debug draw CVars enable wireframe overlays which are mainly useful to debug issues with constraints. This visualization has a high performance impact and thus should only be used in very small test scenes.

These debug draw CVars are available:

  • Jolt.DebugDraw.Bodies: Enables visualization of physics bodies.
  • Jolt.DebugDraw.Constraints: Enables basic visualization of constraints.
  • Jolt.DebugDraw.ConstraintFrames: Enables more detailed visualization of constraints.
  • Jolt.DebugDraw.ConstraintLimits: Enables visualization of constraint limits.

Jolt Debug Visualization

Video: How To Visualize Physics Colliders

Click the image below to watch the video:

video

See Also