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#
| Constant | Behaviour | Typical use |
|---|---|---|
| JOLT_VEHICLE_COLLISION_RAY | Single suspension ray; fastest and the default. | General cars on reasonably smooth collision. |
| JOLT_VEHICLE_COLLISION_SPHERE | Sphere cast using collision_radius. | More tolerant contact over edges and small gaps. |
| JOLT_VEHICLE_COLLISION_CYLINDER | Cylinder 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#
| Option | Effect |
|---|---|
| maximum_slope_angle | Rejects contact normals steeper than the supplied 0..90 degree boundary. |
| maximum_pitch_roll_angle | Limits the pitch/roll angle accepted by the VehicleConstraint; maximum 180. |
| collision_radius | Only controls Sphere cast radius; it does not resize visual wheels. |
var car = jolt_vehicle(chassis, {
collision: JOLT_VEHICLE_COLLISION_SPHERE,
collision_radius: 0.08,
maximum_slope_angle: 50
});