Posts 1–3 of 3 · Page 1 of 1
How to clamp angles?
Title says it all ^^^^^^

Code:
Vector3 Aimbot::NormalizeAngles(Vector3 AngleToNormalize)
{
Vector3 vec = AngleToNormalize;
if (vec.x > 89.0f && vec.x <= 180.0f)
{
vec.x = 89.0f;
}
while (vec.x > 180.f)
{
vec.x -= 360.f;
}
while (vec.x < -89.0f)
{
vec.x = -89.0f;
}
while (vec.y > 180.f)
{
vec.y -= 360.f;
}
while (vec.y < -180.f)
{
vec.y += 360.f;
}
vec.z = 0;
return vec;
}
//Credits -> Dolphin

Originally Posted by
WasserEsser
Code:
Vector3 Aimbot::NormalizeAngles(Vector3 AngleToNormalize)
{
Vector3 vec = AngleToNormalize;
if (vec.x > 89.0f && vec.x <= 180.0f)
{
vec.x = 89.0f;
}
while (vec.x > 180.f)
{
vec.x -= 360.f;
}
while (vec.x < -89.0f)
{
vec.x = -89.0f;
}
while (vec.y > 180.f)
{
vec.y -= 360.f;
}
while (vec.y < -180.f)
{
vec.y += 360.f;
}
vec.z = 0;
return vec;
}
//Credits -> Dolphin
Thanks 2 u and Dolphin
Posts 1–3 of 3 · Page 1 of 1