Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1.     float flPerpendicularAngleRad, flCosPerp, flSinPerp;
  2.     {
  3.         const Vector vecForward(vecCenter - g_pCustomGlobals->m_vecWeaponShootPosition);
  4.         const float flAngle = atan2f(vecForward.y, vecForward.x);
  5.         const float flCurrentRotation = DEG2RAD(m_pTarget->angEyeAngles().y);
  6.         const float flNeededRotation = flCurrentRotation - flAngle;
  7.  
  8.         const float flSin = sinf(flNeededRotation), flCos = cosf(flNeededRotation);
  9.         const Vector vecOldMin(vecMin), vecOldMax(vecMax);
  10.  
  11.         vecMin.x = vecOldMin.x * flCos - vecOldMin.y * flSin;
  12.         vecMin.y = vecOldMin.x * flSin + vecOldMin.y * flCos;
  13.  
  14.         vecMax.x = vecOldMax.x * flCos - vecOldMax.y * flSin;
  15.         vecMax.y = vecOldMax.x * flSin + vecOldMax.y * flCos;
  16.  
  17.         flPerpendicularAngleRad = flAngle - M_PI / 2.f;
  18.         flCosPerp = cosf(flPerpendicularAngleRad);
  19.         flSinPerp = sinf(flPerpendicularAngleRad);
  20.     }
  21.  
  22. ...
  23.  
  24.             Points.emplace_back(vecCenter.x + flRadius2D * flCosPerp, vecCenter.y + flRadius2D * flSinPerp, vecCenter.z + flRadiusHeight * flPointScale); // Left, top
  25.             Points.emplace_back(vecCenter.x - flRadius2D * flCosPerp, vecCenter.y - flRadius2D * flSinPerp, vecCenter.z + flRadiusHeight * flPointScale); // Right, top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement