Skip to content

1681-engine / index / applySteering

Function: applySteering() ​

ts
function applySteering(
   agent, 
   force, 
   maxSpeed, 
   dt
): void;

Defined in: src/nav/steering.ts:169

One step of steering applied to a body: velocity changed by force × dt, capped at maxSpeed, position moved. For bodies with no physics of their own (birds, a crowd of extras); a physics body takes the force instead.

Parameters ​

ParameterType
agentSteerAgent
forceSteerVec
maxSpeednumber
dtnumber

Returns ​

void

Released under the MIT License.