Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Uffe Hammer

Direction vector of an entity

This topic is 6972 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

This is how I get a entity dir vector.. used in my current game:

// return direction vector of entity based on dir - if you pass in 0,0,1, it
will return the forward vector,
// 0, 1, 0, will return the up vector
void GV_GetEntityDirVector(PR_ENTITY *entity, PR_POINT *dir)
{
tvector[0] = dir->x;
tvector[1] = dir->y;
tvector[2] = dir->z;

PR_Transform(entity->orientation.rot_mat);

dir->x = tvector[0];
dir->y = tvector[1];
dir->z = tvector[2];
}

------------------
Jarrod Davis

Share this post


Link to post
Share on other sites
Advertisement
Is it possible to obtain the direction vector of an entity, without storing the old position and calculate a vector to the new position.
I have seen that an entity.orientation.direction vector exist however its always empty.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!