Модератор форума
-
Автор темы
- #1
Короче строго не судите, попытался сделать что то годное. Получилось или нет, судите сами.
C++:
void resolver::resolve_yaw()
{
float no_side = FLT_MAX;
auto animstate = player->get_animation_state();
AnimationLayer layers[15];
AnimationLayer moveLayers[3][15];
memcpy(moveLayers, player->get_animlayers(), sizeof(AnimationLayer) * 15);
auto speed = player->m_vecVelocity().Length2D();
int m_side;
if (speed <= 0.1f)
{
auto delta = math::AngleDiff(player->m_angEyeAngles().y, player->get_animation_state()->m_flGoalFeetYaw);
if (layers[3].m_flWeight == 0.0f && layers[3].m_flCycle == 0.0f)
{
resolving_way = (math::AngleDiff(player->get_animation_state()->m_flEyeYaw, player->get_animation_state()->m_flGoalFeetYaw) <= 0.0) - 1;
}
}
if (int(layers[12].m_flWeight * 1000.0f) == int(layers[6].m_flWeight * 1000.0f))
{
float firstDelta = fabs(layers[6].m_flPlaybackRate - moveLayers[0][6].m_flPlaybackRate);
float secondDelta = fabs(layers[6].m_flPlaybackRate - moveLayers[2][6].m_flPlaybackRate);
float thirdDelta = fabs(layers[6].m_flPlaybackRate - moveLayers[1][6].m_flPlaybackRate);
if (firstDelta < secondDelta || thirdDelta <= secondDelta || (secondDelta * 1000.0))
{
if (firstDelta >= thirdDelta && secondDelta > thirdDelta && !(thirdDelta * 1000.0))
{
m_side= 1;
}
}
else
{
m_side= -1;
}
}
if (m_side= -1)
{
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y - 60.f);
switch (g_ctx.globals.missed_shots[player->EntIndex()] % 2)
{
case 0:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + 60.f);
break;
case 1:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y - 30.f);
break;
}
}
else if (m_side= 1)
{
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + 60.f);
switch (g_ctx.globals.missed_shots[player->EntIndex()] % 2)
{
case 0:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y - 60.f);
break;
case 1:
animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + 30.f);
break;
}
}
}
Последнее редактирование: