
void Aimbot::MakeVector( vector angle, vector& vector)
{
float pitch;
float yaw;
float tmp;
pitch = (float)(angle.x * M_PI / 180);
yaw = (float)(angle.y * M_PI / 180);
tmp = (float)cos(pitch);
vector.x = (float)(-tmp * -cos(yaw));
vector.y = (float)(sin(yaw)*tmp);
vector.z = (float)-sin(pitch);
}
float Aimbot::getFOV(vector angle, vector src, vector dst)
{
vector ang, aim;
float fov;
ang = calcAngle(src, dst);
MakeVector(angle, aim);
MakeVector(ang, ang);
float mag_s = sqrt((aim.x * aim.x) + (aim.y * aim.y) + (aim.z * aim.z));
float mag_d = sqrt((aim.x * aim.x) + (aim.y * aim.y) + (aim.z * aim.z));
float u_dot_v = aim.x * ang.x + aim.y * ang.y + aim.z * ang.z;
fov = acos(u_dot_v / (mag_s*mag_d)) * (180.0 / M_PI);
return fov;
}