Feel TheSense
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Насколько я понял там анимфикс на части клиента а не локала, поэтому как можно его сделать плавным / улучшить?
вот сам код:
вот сам код:
C++:
void Client::UpdateAnimations() {
if (!g_cl.m_local || !g_cl.m_processing)
return;
CCSGOPlayerAnimState* state = g_cl.m_local->m_PlayerAnimState();
if (!state)
return;
// prevent model sway on player.
g_cl.m_local->m_AnimOverlay()[12].m_weight = 0.f;
// update animations with last networked data.
g_cl.m_local->SetPoseParameters(g_cl.m_poses);
// update abs yaw with last networked abs yaw.
g_cl.m_local->SetAbsAngles(ang_t(0.f, g_cl.m_abs_yaw, 0.f));
}
void Client::UpdateInformation() {
if (g_cl.m_lag > 0)
return;
CCSGOPlayerAnimState* state = g_cl.m_local->m_PlayerAnimState();
if (!state)
return;
// update time.
m_anim_frame = g_csgo.m_globals->m_curtime - m_anim_time;
m_anim_time = g_csgo.m_globals->m_curtime;
// current angle will be animated.
m_angle = g_cl.m_cmd->m_view_angles;
// fix landing anim.
if (state->m_land && !state->m_dip_air && state->m_dip_cycle > 0.f)
m_angle.x = -12.f;
math::clamp(m_angle.x, -90.f, 90.f);
m_angle.normalize();
// write angles to model.
g_csgo.m_prediction->SetLocalViewAngles(m_angle);
// set lby to predicted value.
g_cl.m_local->m_flLowerBodyYawTarget() = m_body;
// CCSGOPlayerAnimState::Update, bypass already animated checks.
if (state->m_frame == g_csgo.m_globals->m_frame)
state->m_frame -= 1;
// call original, bypass hook.
if (g_hooks.m_UpdateClientSideAnimation) //not real fix but why not
g_hooks.m_UpdateClientSideAnimation(g_cl.m_local);
// get last networked poses.
g_cl.m_local->GetPoseParameters(g_cl.m_poses);
// store updated abs yaw.
g_cl.m_abs_yaw = state->m_goal_feet_yaw;
// we landed.
if (!m_ground && state->m_ground) {
m_body = m_angle.y;
m_body_pred = m_anim_time;
}
// walking, delay lby update by .22.
else if (state->m_speed > 0.1f) {
if (state->m_ground)
m_body = m_angle.y;
m_body_pred = m_anim_time + 0.22f;
}
// standing update every 1.1s
else if (m_anim_time > m_body_pred) {
m_body = m_angle.y;
m_body_pred = m_anim_time + 1.1f;
}
// save updated data.
m_rotation = g_cl.m_local->m_angAbsRotation();
m_speed = state->m_speed;
m_ground = state->m_ground;
}