Skip to content

five-on-it / packages/ai/src/steer-vehicle / driveCar

Function: driveCar() ​

driveCar(ai, npc, car, goal, pit, targetCar): DriveInput

Defined in: packages/ai/src/steer-vehicle.ts:488

One tick of driving car toward goal along the NPC's route (planned by planRoute): pure pursuit for the steering, the speed plan for the throttle, the turn-around and the stall recovery on top. targetCar is the car being rammed, if any (its rear quarter is the ram's point when the profile pits).

Parameters ​

ai ​

AiWorld

npc ​

NpcState

car ​

number

goal ​

DriveGoal

pit ​

boolean

targetCar ​

number

Returns ​

DriveInput