Body State
Motion Type
Mesh, HeightField and Plane remain static-only. Do not use a motion-type change to bypass geometry restrictions. Prefer creating the body with its intended motion type; switching an existing body is a validated native operation, not just editing a GML field.
| API | Contract |
|---|---|
| JOLT_MOTION_STATIC (0) | Immovable geometry; not force-driven. |
| JOLT_MOTION_KINEMATIC (1) | Application-driven motion that interacts through velocity with Dynamic bodies. |
| JOLT_MOTION_DYNAMIC (2) | Mass, gravity, contacts, forces and impulses drive motion. |
| body.set_motion_type(motion) / get_motion_type() | Requests or reads the native motion type. The setter can reject unsupported transitions. |
if (!body.set_motion_type(JOLT_MOTION_KINEMATIC)) {
show_debug_message(jolt_get_error_message());
}New related workflows#
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 |
|---|---|---|
| JoltBody.get_motion_type | JoltBody.get_motion_type() | JOLT_MOTION_STATIC/KINEMATIC/DYNAMIC; setter Boolean, getter enum or undefined. Native rejects unsupported changes/geometry; wrapper updates motion_type only after success. |
| JoltBody.set_motion_type | JoltBody.set_motion_type(motion_type) | JOLT_MOTION_STATIC/KINEMATIC/DYNAMIC; setter Boolean, getter enum or undefined. Native rejects unsupported changes/geometry; wrapper updates motion_type only after success. |