2009-06-06 05:00:18 UTC
Thanks for the reply.
I've been able to get something simple started with steerForSeek though I am having a little trouble figuring out how to properly stop my vehicle(Once the target has been reached).
void Test::update (const float currentTime, const float elapsedTime)
{
Vec3 target = Vec3(1,1,0);
Vec3 pos = position();
Vec3 steer = Vec3(0,0,0);
float d = Vec3::distance(target, pos);
if(d < 1)
moving = false;
if(moving){
steer = steerForSeek(target);
}
else{
applyBrakingForce(.75,elapsedTime);
}
applySteeringForce (steer, elapsedTime);
}
.75 doesn't stop the vehicle. A greater force will do it but it'll look awkward, a sudden stop and some twitching.