who are you dot idk
-
Автор темы
- #1
В шапке
(no ad)
C++:
void MovementFix(Vector& oldang)
{
Vector vMovements(g::pCmd->forwardmove, g::pCmd->sidemove, 0.f);
if (vMovements.Length2D() == 0)
return;
Vector vRealF, vRealR;
Vector aRealDir = g::pCmd->viewangles;
aRealDir.Clamp();
g_Math.AngleVectors(aRealDir, &vRealF, &vRealR, nullptr);
vRealF[2] = 0;
vRealR[2] = 0;
VectorNormalize(vRealF);
VectorNormalize(vRealR);
Vector aWishDir = oldang;
aWishDir.Clamp();
Vector vWishF, vWishR;
g_Math.AngleVectors(aWishDir, &vWishF, &vWishR, nullptr);
vWishF[2] = 0;
vWishR[2] = 0;
VectorNormalize(vWishF);
VectorNormalize(vWishR);
Vector vWishVel;
vWishVel[0] = vWishF[0] * g::pCmd->forwardmove + vWishR[0] * g::pCmd->sidemove;
vWishVel[1] = vWishF[1] * g::pCmd->forwardmove + vWishR[1] * g::pCmd->sidemove;
vWishVel[2] = 0;
float a = vRealF[0], b = vRealR[0], c = vRealF[1], d = vRealR[1];
float v = vWishVel[0], w = vWishVel[1];
float flDivide = (a * d - b * c);
float x = (d * v - b * w) / flDivide;
float y = (a * w - c * v) / flDivide;
g::pCmd->forwardmove = x;
g::pCmd->sidemove = y;
}
Последнее редактирование: