game_shared/base_playeranimstate.cpp
515253545556
ConVar mp_ik( "mp_ik", "1", FCVAR_REPLICATED, "Use IK on in-place turns." );
// Pose parameters stored for debugging.
float g_flLastBodyPitch, g_flLastBodyYaw, m_flLastMoveYaw;
51525354555657585960
ConVar mp_ik( "mp_ik", "1", FCVAR_REPLICATED, "Use IK on in-place turns." );
#ifdef CLIENT_DLL
extern ConVar cl_jimmyleg_mode;
#endif
// Pose parameters stored for debugging.
float g_flLastBodyPitch, g_flLastBodyYaw, m_flLastMoveYaw;
426427428429430431432
{
Activity act = GetCurrentMainSequenceActivity();
return (act == ACT_RUN || act == ACT_WALK || act == ACT_RUNTOIDLE || act == ACT_RUN_CROUCH);
}
void CBasePlayerAnimState::ComputeAimSequence()
430431432433434435436
{
Activity act = GetCurrentMainSequenceActivity();
return (act == ACT_RUN || act == ACT_WALK || act == ACT_RUNTOIDLE || act == ACT_RUN_CROUCH || act == ACT_HOP); // FF: added ACT_HOP
}
void CBasePlayerAnimState::ComputeAimSequence()
539540541542543544
void CBasePlayerAnimState::ComputePlaybackRate()
{
VPROF( "CBasePlayerAnimState::ComputePlaybackRate" );
if ( m_AnimConfig.m_LegAnimType != LEGANIM_9WAY && m_AnimConfig.m_LegAnimType != LEGANIM_8WAY )
{
// When using a 9-way blend, playback rate is always 1 and we just scale the pose params
543544545546547548549550551552553554555556557558559560561
void CBasePlayerAnimState::ComputePlaybackRate()
{
VPROF( "CBasePlayerAnimState::ComputePlaybackRate" );
#ifdef CLIENT_DLL
if (cl_jimmyleg_mode.GetInt() == 2 && m_AnimConfig.m_LegAnimType != LEGANIM_8WAY)
{
// When using a 9-way blend, playback rate is always 1 and we just scale the pose params
// to speed up or slow down the animation.
bool bIsMoving;
float flRate = CalcMovementPlaybackRate( &bIsMoving );
if ( bIsMoving )
GetOuter()->SetPlaybackRate( flRate );
else
GetOuter()->SetPlaybackRate( 1 );
}
#endif
if ( m_AnimConfig.m_LegAnimType != LEGANIM_9WAY && m_AnimConfig.m_LegAnimType != LEGANIM_8WAY )
{
// When using a 9-way blend, playback rate is always 1 and we just scale the pose params
655656657658659660661662663664
{
vCurMovePose.x = cos( DEG2RAD( flYaw ) ) * flPlaybackRate;
vCurMovePose.y = -sin( DEG2RAD( flYaw ) ) * flPlaybackRate;
}
GetOuter()->SetPoseParameter( pStudioHdr, iMoveX, vCurMovePose.x );
GetOuter()->SetPoseParameter( pStudioHdr, iMoveY, vCurMovePose.y );
m_vLastMovePose = vCurMovePose;
}
672673674675676677678679680681682683684685686
{
vCurMovePose.x = cos( DEG2RAD( flYaw ) ) * flPlaybackRate;
vCurMovePose.y = -sin( DEG2RAD( flYaw ) ) * flPlaybackRate;
// AfterShock - player animations can be tweaked using these values
// but the clamp is at 1.0f so base animation must be fast
// cos we can only slow it down, not speed it up.
//vCurMovePose.x = cos( DEG2RAD( flYaw ) ) * 1.0f;
//vCurMovePose.y = -sin( DEG2RAD( flYaw ) ) * 1.0f;
}
GetOuter()->SetPoseParameter( pStudioHdr, iMoveX, vCurMovePose.x );
GetOuter()->SetPoseParameter( pStudioHdr, iMoveY, vCurMovePose.y );
m_vLastMovePose = vCurMovePose;
}