Shape Resources
Loading .jcol Files
jolt_shape_load(path, cache_key=undefined) loads prebuilt collision data synchronously. This is a collision format, not an OBJ or .gmodel render model. Prepare .jcol files with the project's collision_converter and ship them as accessible included files.
The loader validates a 32-byte JCOL v1 header, little-endian data, zero flags and exact payload size. The file is limited to 8 MiB. Unsupported versions, malformed data and missing files fail with undefined and an error; do not interpret them as empty geometry.
var terrain = jolt_shape_load("terrain.jcol");
if (is_undefined(terrain)) {
show_debug_message(jolt_get_error_message());
} else {
var ground = terrain.create_static(0, 0, 0);
if (is_undefined(ground)) show_debug_message(jolt_get_error_message());
terrain.destroy();
}Verified operation contracts#
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
| Symbol / owner | Signature | Operation contract |
|---|---|---|
| jolt_shape_load | jolt_shape_load(path, cache_key = undefined) | Loads a validated binary collision asset (not .jolt.json), JoltShape/undefined. Default cache key is path; existing cache returns a shared resource without rereading the file. |