Enemy ViewAngles

Posts 1–11 of 11 · Page 1 of 1
Enemy ViewAngles
Hey, i was wondering, is it possible to take
an enemy's "screen" and check if he's aiming
at you?
Thanks.
Quote Originally Posted by vaisefud3 View Post
Hey, i was wondering, is it possible to take
an enemy's "screen" and check if he's aiming
at you?
Thanks.
Why you don't try find by yourself? it's easy, it's yaw/pitch/roll
Quote Originally Posted by dreek1 View Post
Why you don't try find by yourself? it's easy, it's yaw/pitch/roll
Yes, I've seen yaw/pitch/roll in CPlayer class, but I have no idea on how to check if I'm in it.
Anyway, thanks for the ref.
u can create a line
- from enemy's head
- to yaw / pitch point with some distance u specify

send this to intersectsegment and check if visible && hobjImpact equals to your object
Quote Originally Posted by I2espect View Post
u can create a line
- from enemy's head
- to yaw / pitch point with some distance u specify

send this to intersectsegment and check if visible && hobjImpact equals to your object
Now this is helpful. I would create variables for Query and Info, but how to specify the
yaw and pitch? I can do it by position. Am I in the right path?
What do u mean how to specify yaw.pitch..
U read them from the player class
And u calculate d3dxvector3 point (toPos in the query)
Quote Originally Posted by I2espect View Post
What do u mean how to specify yaw.pitch..
U read them from the player class
And u calculate d3dxvector3 point (toPos in the query)
So it is like this?

Code:
oIntersectSegment = (IntersectSegment)(aIntersectSegment);

iQuery.m_From = TargetPos;
iQuery.m_To = MePos;

oIntersectSegment(iQuery, &iInfo);

if(iInfo->hObjImpact == Me->Object) //Returns true if aiming at me
Quote Originally Posted by vaisefud3 View Post
So it is like this?

Code:
oIntersectSegment = (IntersectSegment)(aIntersectSegment);

iQuery.m_From = TargetPos;
iQuery.m_To = MePos;

oIntersectSegment(iQuery, &iInfo);

if(iInfo->hObjImpact == Me->Object) //Returns true if aiming at me
No not what i meant.. m_from correct but m_to not
M_to is the point where the enemy is aiming
Quote Originally Posted by I2espect View Post
No not what i meant.. m_from correct but m_to not
M_to is the point where the enemy is aiming
And that's my problem, how to get it. You mentioned pitch and yaw but I never seen to get a location from them.
Quote Originally Posted by vaisefud3 View Post
And that's my problem, how to get it. You mentioned pitch and yaw but I never seen to get a location from them.
Code:
D3DXVECTOR3 direction;
dir.x = -cosPitch * cosYaw;
dir.y = -cosPitch * sinYaw;
dir.z = -sinPitch;
const float trailLen = 200.f;
D3DXVECTOR3 trail(dir.x * trailLen, dir.y * trailLen, dir.z * trailLen);
trailEnd = headPosition + dir * trailLen;
credits : HaxMaxx from UC
Local msgtshrt
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?