Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CalculateAngle(const Vector &source, const Vector &destination, QAngle& angles)
- {
- Vector delta = source - destination;
- angles.pitch = static_cast< float >(asin(delta.z / delta.Length()) * M_RADPI);
- angles.yaw = static_cast< float >(atan(delta.y / delta.x) * M_RADPI);
- angles.roll = 0.0f;
- if (delta.x >= 0.0f)
- angles.yaw += 180.0f;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement