I've been at this for a week now, and I finally understand trigonometry enough to get a majority of the math. I've pieced together a lot of source, and learned a lot. My only issue is trying to set up the aimbot maths. A lot of them include after atan2(deltaX/deltaY) more math such as * 180 / 3.14 + 180.0f;

Pic Here

(My beautiful drawing)

For the piece I drew, the math would be tan YAW = O/A

From maxdd's aimbot geometry tutorial, the YAW = tan((src[0] - dst[0]) / (src[1] - dst[1]))

He uses angles[0] = 90.0f + (float)(atan2f(deltaX, deltaZ) * 57.29577513082f); for getting the YAW in AssaultCube. My issue is when I use this, if I'm left and going left of the enemy, it pushes the camera further left. Same with right and going right.

I'm not quite sure how to fix this, and I've tried just about everything I can think of. (Including different methods from maxdd's). My big question here is how do I solve for each of the sectors? I can get the first part, it's the putting it in the specific range that I'm having trouble with (0 - 90, 90 - 180, 180 - 270, 270 - 360).

The yaw goes from 0-360, and pitch from -90 to 90 (I have the pitch working).

Pic Here

(My beautiful drawing)

For the piece I drew, the math would be tan YAW = O/A

From maxdd's aimbot geometry tutorial, the YAW = tan((src[0] - dst[0]) / (src[1] - dst[1]))

He uses angles[0] = 90.0f + (float)(atan2f(deltaX, deltaZ) * 57.29577513082f); for getting the YAW in AssaultCube. My issue is when I use this, if I'm left and going left of the enemy, it pushes the camera further left. Same with right and going right.

I'm not quite sure how to fix this, and I've tried just about everything I can think of. (Including different methods from maxdd's). My big question here is how do I solve for each of the sectors? I can get the first part, it's the putting it in the specific range that I'm having trouble with (0 - 90, 90 - 180, 180 - 270, 270 - 360).

The yaw goes from 0-360, and pitch from -90 to 90 (I have the pitch working).

Last edited: