Game Development Reference
In-Depth Information
Once our force is calculated, we simply apply the force through the agent's ApplyForce
function. Now, we take our force and calculate the agent's change in acceleration. With ac-
celeration, we can derive the change in velocity by multiplying acceleration by
deltaTimeInSeconds . The change in velocity is added to the current velocity of the
agent and the resulting vector is the agent's forward direction.
This is just one of many ways in which you can apply steering forces to agents, and it
makes many assumptions about how our agents will look when changing directions and
speeds. Later, we can refine steering even further to smooth out changes in the direction,
for example.
Tip
Remember that all time calculations take place in meters, seconds, and kilograms.
Search WWH ::




Custom Search