Archived

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

Uffe Hammer

Direction vector of an entity

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