Арбитр
-
Автор темы
- #1
C++:
if ( aaVar->distortion && real && g_bStand )
{
v22 = (aaVar->distortionSpeed / 100.0) * 0.0625;
v13 = *libm_sse2_pow_precise(v17, v18).m128_u64;
switch_1 = ::switchSide;
distortionAngle = ((1.0 - v13) * aaVar->distortionRange) - (aaVar->distortionRange * 0.5);
if ( ::switchSide )
cmd->viewangles.y = distortionAngle + cmd->viewangles.y;
else
cmd->viewangles.y = cmd->viewangles.y - distortionAngle;
distortionTimer = distortionTimer + v22;
if ( distortionTimer >= 0.69999999 )
{
distortionTimer = 0.0;
::switchSide = switch_1 == 0;
}
}
C++:
const float DISTORTION_SPEED = 50.f;
const float DISTORTION_RANGE = 100.f;
bool g_bSwitch = false;
float g_flTimer = 0.f;
void DoDistortion( )
{
float speed = ( DISTORTION_SPEED * 0.01f ) * 0.0625f;
float distortion_angle = DISTORTION_RANGE * ( 1.f - std::powf( 1.f - g_flTimer, 2 ) ) - ( DISTORTION_RANGE * 0.5f );
g_cl.m_cmd->m_view_angles.y += g_bSwitch ? distortion_angle : -distortion_angle;
// update timer and go back when we at the end if distortion flip
g_flTimer += speed;
if ( g_flTimer >= 0.7f )
{
g_flTimer = 0.f;
g_bSwitch = !g_bSwitch;
}
}
Огромное спасибо за данные анти аимы Dander