Quote:
Originally Posted by Pierre-Marie Baty
why so complicated, guys ?
Code:
// is enemy looking at more than 90° aside of the bot's forward direction ?
if (fabs (WrapAngle (pEnemyEdict->v.v_angle.y - pBotEdict->v.v_angle.y)) > 90)
{
// yes, it is (meaning, bot sees the back of its enemy)
}
else
{
// no, it is not (enemy is facing the bot)
}

|
Why so complicated? Well, in my case I simply don't know what some of the the v.(whatever) values represent.
For the above example, what does
v.v_angle.y represent?
v_angle; // Viewing angle (player only)
Is this the vector describing the direction a player is looking? That's my guess based on the comment. Is there a document somewhere describing what these values are?
I'm not completely clueless. I did take (and pass) a linear algerbra course which covered everything about vectors, but that was years ago, and I've forgotten almost all of it, fortunately I saved the book and I've dusted it off as my reference. I think I just need a few pointers to get me going in the right direction.