‹›
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#

Syntax
var wheel = vehicle.get_wheel(index);

Wheel snapshot#

FieldType / units
indexZero-based integer.
positionWorld-space {x,y,z}.
rotationAuthoritative quaternion {x,y,z,w}.
rotation_eulerGameMaker helper in degrees.
transform{position, rotation}.
steering_angleDegrees.
suspension_lengthWorld units.
suspension_compressionNormalized 0..1.
angular_velocityRadians per second.
rotation_angleDegrees.
radius / widthConfigured world units.
drivenBoolean driven flag.
has_contactBoolean.
contactStruct or undefined.

Contact struct#

FieldMeaning
body_handleSafe public JoltBody handle, or 0 when unavailable.
bodyManaged JoltBody wrapper resolved from the handle, or undefined.
positionWorld-space contact point.
normalWorld-space surface normal.
GML
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 / ownerSignatureOperation contract
JoltVehicle.get_wheelJoltVehicle.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.