Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float flPerpendicularAngleRad, flCosPerp, flSinPerp;
- {
- const Vector vecForward(vecCenter - g_pCustomGlobals->m_vecWeaponShootPosition);
- const float flAngle = atan2f(vecForward.y, vecForward.x);
- const float flCurrentRotation = DEG2RAD(m_pTarget->angEyeAngles().y);
- const float flNeededRotation = flCurrentRotation - flAngle;
- const float flSin = sinf(flNeededRotation), flCos = cosf(flNeededRotation);
- const Vector vecOldMin(vecMin), vecOldMax(vecMax);
- vecMin.x = vecOldMin.x * flCos - vecOldMin.y * flSin;
- vecMin.y = vecOldMin.x * flSin + vecOldMin.y * flCos;
- vecMax.x = vecOldMax.x * flCos - vecOldMax.y * flSin;
- vecMax.y = vecOldMax.x * flSin + vecOldMax.y * flCos;
- flPerpendicularAngleRad = flAngle - M_PI / 2.f;
- flCosPerp = cosf(flPerpendicularAngleRad);
- flSinPerp = sinf(flPerpendicularAngleRad);
- }
- ...
- Points.emplace_back(vecCenter.x + flRadius2D * flCosPerp, vecCenter.y + flRadius2D * flSinPerp, vecCenter.z + flRadiusHeight * flPointScale); // Left, top
- 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