Sign in to follow this  
discodowney

Calculating a characters heading

Recommended Posts

Do you mean in 3D or 2D?

In 2D, if your up vector is in the y-direction ( 0, 1, 0 ), then the angular direction is:

float heading = atan2( velocity.x, velocity.z );

If you're just interested in a vector direction, normalize the velocity.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this