Getting Camera Rotation from FrontVector
#1

I've just reverse-engineered an aimbot cheat and I'm trying to develop a detection tool. Everything went fine until I ran into trigonometry.

I want to get players' Camera Rotation X. (GTA SA Address: 0xB6F258) After some testing, I found out that Cam Rot X is however proportional to GetPlayerCameraFrontVector X and Y Pos.

Any info or snippets are welcomed.


Edit: This and this are what I'm looking for. (delete these links if they are against the rules)

Edit 2: I used this function:
Код:
Float: GetPlayerCameraFacingAngle(playerid) // Pottus
{
    new Float: vX, Float: vY;
    if(GetPlayerCameraFrontVector(playerid, vX, vY, Float: playerid))
	{
        if((vX = -atan2(vX, vY)) < 0.0) return vX + 360.0;
        return vX;
    }
    return 0.0;
}
to calculate camera facing angle from Cam Rot X and I found something nice:

Cam Rot X = -PI/2 => Camera Facing Angle = 0
Cam Rot X = 0.0 => Camera Facing Angle = 90
Cam Rot X = PI/2 => Camera Facing Angle = 180
Cam Rot X = PI => Camera Facing Angle = 270

Edit 3:

Finally resolved it thanks to Hiddos:
Quote:

Hiddos: Subtract 90 from the facing angle
Hiddos: Then multiply it with pi/180

Reply


Messages In This Thread
Getting Camera Rotation from FrontVector - by Spmn - 16.10.2015, 22:43
Re: Getting Camera Rotation from FrontVector - by Spmn - 17.10.2015, 12:06
Re: Getting Camera Rotation from FrontVector - by AbyssMorgan - 17.10.2015, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)