Jump to content
  • Advertisement


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

Uffe Hammer

Direction vector of an entity

This topic is 7055 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


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;


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

Jarrod Davis

Share this post

Link to post
Share on other sites
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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!