Share

OpenSteer

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Where to start

You are viewing a single message from this topic. View all messages.

  1. 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.

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.