Vehicles
Wheel Contacts
Returns a per-wheel snapshot containing transform, suspension state and the current native ground contact.
Contact is undefined while airborne. A valid contact includes a safe public body handle, optional managed wrapper, world position and world normal.
Syntax#
var wheel = vehicle.get_wheel(index);Wheel snapshot#
| Field | Type / units |
|---|---|
| index | Zero-based integer. |
| position | World-space {x,y,z}. |
| rotation | Authoritative quaternion {x,y,z,w}. |
| rotation_euler | GameMaker helper in degrees. |
| transform | {position, rotation}. |
| steering_angle | Degrees. |
| suspension_length | World units. |
| suspension_compression | Normalized 0..1. |
| angular_velocity | Radians per second. |
| rotation_angle | Degrees. |
| radius / width | Configured world units. |
| driven | Boolean driven flag. |
| has_contact | Boolean. |
| contact | Struct or undefined. |
Contact struct#
| Field | Meaning |
|---|---|
| body_handle | Safe public JoltBody handle, or 0 when unavailable. |
| body | Managed JoltBody wrapper resolved from the handle, or undefined. |
| position | World-space contact point. |
| normal | World-space surface normal. |
var wheel = car.get_wheel(0);
if (!is_undefined(wheel) && wheel.has_contact) {
draw_text(16, 16, "ground body=" + string(wheel.contact.body_handle));
}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 |
|---|---|---|
| JoltVehicle.get_wheel | JoltVehicle.get_wheel(index) | Zero-based index; build required. Returns a snapshot with world position/rotation/rotation_euler/transform, has_contact, contact (body_handle/position/normal and optional body), steering_angle, suspension_length/compression, angular_velocity, rotation_angle, radius, width, driven. Invalid index/wrapper yields undefined. Steering/rotation_angle are degrees, angular_velocity rad/s; lengths m. A wheel is not a separate body. |