Physics · interface

VehicleOptions

Explained in Your first game, Rigid bodies.

interface VehicleOptions
import type { VehicleOptions } from '@driftengine/physics';

Properties

NameTypeDescription
wheelsreadonly WheelOptions[]
maxSteerTangentoptionalnumberMaximum steering angle, as the tangent of the angle rather than the angle.
engineForceoptionalnumberNewtons at full throttle, shared across driven wheels.
brakeForceoptionalnumberNewtons at full brake.
longitudinaloptionalTyreCurve
lateraloptionalTyreCurve
filteroptionalQueryFilter
groundoptionalGroundProbeA surface the wheels can rest on that is not a body.
More

The same seam CharacterController takes, and here for the same reason plus one: a consumer whose ground is a height function had a character that stood on it and a car that fell through it, so the world's floor was two things that had to be kept in step by hand. It was reported that way — a hundred lines of ground query written consumer-side, and then written again for everything else that stands on it.

Consulted only where the wheel's ray found no body, on the same ruling the controller carries: a body is a thing that is there and a surface is a description of where the ground is.