Shape Queries
Query Filtering
The options argument may also directly contain a layer, an array of layers or a numeric mask. A struct is needed to combine filtering with rotation and ignore. Filters affect this query only; they do not change the world's collision matrix.
| API | Contract |
|---|---|
| layers | One JoltLayer or an array of layers in the same world. |
| mask | Numeric user-layer mask; takes precedence over layers. Zero means all layers, not none. |
| ignore | One live managed JoltBody from the same world; not an arbitrary array. |
| rotation | Quaternion {x,y,z,w}; identity by default. |
| rotation_euler | {x,y,z} in degrees, XYZ order; overrides a valid quaternion when both are supplied. |
// body and obstacles are previously validated managed objects.
var r = jolt_overlap_box(0, 0, 2, 1, 2, 1, {
layers: obstacles,
ignore: body,
rotation_euler: {x: 0, y: 0, z: 45}
});
if (r.error_code != 0) show_debug_message(r.error_message);