‹›
Vehicles

Collision Testers and Layers

Chooses how every virtual wheel searches for ground and which surfaces are eligible road contacts.

The tester uses the chassis ObjectLayer, the world's current collision matrix and the configured slope limit. Sensor bodies are always skipped.

Collision modes#

ConstantBehaviourTypical use
JOLT_VEHICLE_COLLISION_RAYSingle suspension ray; fastest and the default.General cars on reasonably smooth collision.
JOLT_VEHICLE_COLLISION_SPHERESphere cast using collision_radius.More tolerant contact over edges and small gaps.
JOLT_VEHICLE_COLLISION_CYLINDERCylinder cast matching the wheel.Detailed wheel-volume contact at greater cost.

Layer filtering#

  • A ground layer must be enabled against the chassis layer in the JoltLayer matrix.
  • Changing the chassis layer changes the filter used by its wheel tester.
  • Sensors and triggers cannot become drivable ground through this vehicle API.
  • Box, Mesh and HeightField ground are supported according to their ordinary body rules.
  • Dynamic and Kinematic surfaces contribute their contact-point velocity, enabling moving platforms.

Slope and orientation limits#

OptionEffect
maximum_slope_angleRejects contact normals steeper than the supplied 0..90 degree boundary.
maximum_pitch_roll_angleLimits the pitch/roll angle accepted by the VehicleConstraint; maximum 180.
collision_radiusOnly controls Sphere cast radius; it does not resize visual wheels.
GML
var car = jolt_vehicle(chassis, {
    collision: JOLT_VEHICLE_COLLISION_SPHERE,
    collision_radius: 0.08,
    maximum_slope_angle: 50
});

Choosing a tester#

  • Start with Ray and validate suspension and layer setup first.
  • Try Sphere when rays lose contact on sharp terrain seams.
  • Use Cylinder only when its additional contact volume materially improves the intended handling.