Wheel settings and orientation
Reuse wheel configurations and select vehicle and wheel forward/up axes before building.
Verified against the project sources on 19 September 2026.
Syntax#
jolt_vehicle_wheel(local_x, local_y, local_z);
car.add_wheel(wheel_settings);
car.set_forward(x, y, [z]);
car.set_orientation(fx, fy, fz, [ux], [uy], [uz]);jolt_vehicle_wheel returns JoltVehicleWheelSettings, a plain configuration with no physical body or native resource. Its setters return the settings object for chaining. Validation occurs when car.add_wheel(settings) copies the configuration and returns a numeric wheel index. Later changes to the settings do not modify attached wheels. The original add_wheel(x,y,z,options) remains supported.
Settings methods#
| API / field | Contract |
|---|---|
| JoltVehicleWheelSettings.set_position(x,y,z) | Body-local suspension hard point. |
| JoltVehicleWheelSettings.set_radius(value) | Sets the existing wheel option radius; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_width(value) | Sets the existing wheel option width; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_steering(value) | Sets the existing wheel option steering; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_driven(value) | Sets the existing wheel option driven; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_brake(value) | Sets the existing wheel option brake; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_handbrake(value) | Sets the existing wheel option handbrake; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_max_steering_angle(value) | Sets the existing wheel option max_steering_angle; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_inertia(value) | Sets the existing wheel option inertia; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_angular_damping(value) | Sets the existing wheel option angular_damping; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_max_brake_torque(value) | Sets the existing wheel option max_brake_torque; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_max_handbrake_torque(value) | Sets the existing wheel option max_handbrake_torque; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_min(value) | Sets the existing wheel option suspension_min; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_max(value) | Sets the existing wheel option suspension_max; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_frequency(value) | Sets the existing wheel option suspension_frequency; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_damping(value) | Sets the existing wheel option suspension_damping; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_preload(value) | Sets the existing wheel option suspension_preload; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_longitudinal_friction(value) | Sets the existing wheel option longitudinal_friction; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_lateral_friction(value) | Sets the existing wheel option lateral_friction; same units and validation as add_wheel options. |
| JoltVehicleWheelSettings.set_suspension_direction(x,y,z) | Explicit suspension direction. |
| JoltVehicleWheelSettings.set_suspension_force_point(x,y,z) | Explicit local suspension force point. |
| JoltVehicleWheelSettings.set_forward(x,y,z=0) | Wheel forward direction, default up +Z. |
| JoltVehicleWheelSettings.set_orientation(fx,fy,fz,ux=0,uy=0,uz=1) | Wheel forward/up; also sets steering axis to up. Suspension direction is separate. |
| JoltVehicle.set_forward(x,y,z=0) / JoltVehicle.set_orientation(fx,fy,fz,ux=0,uy=0,uz=1) | Boolean result; set before adding any wheels. |
Example#
// car is an unbuilt vehicle with no wheels yet.
car.set_forward(1, 0, 0);
var wheel = jolt_vehicle_wheel(1, -0.8, 0);
wheel.set_radius(0.325).set_driven(true).set_steering(false);
wheel.set_inertia(2.5).set_angular_damping(0.5);
var wheel_index = car.add_wheel(wheel);
// Add the other wheels, then call car.build().Vehicles default to +Y forward and +Z up. New wheels inherit the chosen vehicle basis and default suspension along minus up. Directions must be finite, nonzero and perpendicular, and are normalized internally. Vehicle orientation locks once any wheel exists. All configuration finishes before build(). Wheel transforms, debug axes and get_forward_speed() follow the configured basis; render meshes retain local axle +X and up +Z. These orientation changes require the updated bridge DLL.
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.set_forward | JoltVehicle.set_forward(x, y, z=0) | Boolean; before adding the first wheel and build. Local nonzero perpendicular forward/up, normalized; set_forward uses +Z up. |
| JoltVehicle.set_orientation | JoltVehicle.set_orientation(fx, fy, fz, ux=0, uy=0, uz=1) | Boolean; before adding the first wheel and build. Local nonzero perpendicular forward/up, normalized; set_forward uses +Z up. |