Shape Queries

Reusable Query Shapes

Create one immutable convex JoltShape and reuse it across probes. Generic queries accept supported convex primitives and Convex resources. Mesh, HeightField and Plane can be targets in the world but cannot be the query shape.

GML
// Create event, after jolt_start().
probe = jolt_shape_box(1, 0.5, 1);

// Step event; probe is a resource, not a body.
if (!is_undefined(probe) && probe.is_valid()) {
    var r = jolt_overlap_shape(probe, 0, 0, 2);
    if (r.error_code != 0) show_debug_message(r.error_message);
}

// Cleanup event, before jolt_stop().
if (!is_undefined(probe)) probe.destroy();

Keep the wrapper alive for subsequent queries. destroy() releases this wrapper's reference; do not use it afterwards. A cache key is optional and has explicit identity semantics, not automatic geometry deduplication.