Body State

Motion Quality and CCD

Discrete simulation samples movement at steps and can miss a thin obstacle when a fast body crosses it between samples. LinearCast CCD sweeps supported moving geometry to reduce this tunnelling. It costs more than Discrete and is not full rotational CCD.

APIContract
body.set_ccd(enabled) / get_ccd()Convenience switch/readback for LinearCast versus Discrete.
body.set_motion_quality(quality) / get_motion_quality()Explicit motion-quality API. Discrete is the default.
GML
var projectile = jolt_sphere_create_dynamic(0, 0, 2, 0.1);
if (!is_undefined(projectile)) {
    if (!projectile.set_ccd(true)) {
        show_debug_message(jolt_get_error_message());
    }
}

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 / ownerSignatureOperation contract
JoltBody.get_ccdJoltBody.get_ccd()DISCRETE or LINEAR_CAST; Boolean CCD switches between them. Setters Boolean, getters enum/Boolean or undefined. LINEAR_CAST requires supported Dynamic motion; not a substitute for correct collision geometry.
JoltBody.get_motion_qualityJoltBody.get_motion_quality()DISCRETE or LINEAR_CAST; Boolean CCD switches between them. Setters Boolean, getters enum/Boolean or undefined. LINEAR_CAST requires supported Dynamic motion; not a substitute for correct collision geometry.
JoltBody.set_ccdJoltBody.set_ccd(enabled)DISCRETE or LINEAR_CAST; Boolean CCD switches between them. Setters Boolean, getters enum/Boolean or undefined. LINEAR_CAST requires supported Dynamic motion; not a substitute for correct collision geometry.
JoltBody.set_motion_qualityJoltBody.set_motion_quality(quality)DISCRETE or LINEAR_CAST; Boolean CCD switches between them. Setters Boolean, getters enum/Boolean or undefined. LINEAR_CAST requires supported Dynamic motion; not a substitute for correct collision geometry.