Debug

Visualizing Contacts

Displays current rigid-body and character contact points and their normals.

JOLT_DEBUG_CONTACTS reads the latest managed collision drain produced by jolt_update(). Exit events are omitted because they no longer have a current contact point.

Enable contacts#

GML
jolt_debug_enable(true);
jolt_debug_set(JOLT_DEBUG_CONTACTS, true);

jolt_update();
jolt_debug_draw();

Rigid-body markers#

  • Ordinary contacts use a red cross at event.position.
  • A yellow segment extends 0.55 world units along event.normal.
  • JOLT_COLLISION_EXIT events are not drawn.
  • Sensor contacts are hidden unless JOLT_DEBUG_SENSORS is also enabled.

Character contacts#

Character body contacts and character-pair contacts are drawn inside JOLT_DEBUG_CHARACTERS. Removed events are skipped. Pair contacts use a red marker plus normal; body-contact sensor markers still require the SENSORS flag.

Debugging missing contacts#

  • Verify that the layer matrix allows the pair to collide.
  • Check that jolt_update() completed before drawing.
  • Enable JOLT_DEBUG_SENSORS when either body is a sensor.
  • Inspect dropped collision counters if the scene produces more events than the bounded native queue can retain.