-
Автор темы
- #1
lby seems to be popular again and if anyone's trying to paste here's just more code available for supremacy, this is used before any velocity modifications in updateanimations inside of aimbot.cpp.
LandFall:
state->m_bOnGround = (m_player->m_fFlags() & FL_ONGROUND);
bool bPreviousGroundState = state->m_bOnGround;
float flDistanceFell = 0.f;
float m_flLeftGroundHeight = 0.f;
bool m_bLandedOnGroundThisFrame = (bPreviousGroundState != state->m_bOnGround && state->m_bOnGround);
bool m_bLefttheGroundThisFrame = (bPreviousGroundState != state->m_bOnGround && !state->m_bOnGround);
if (m_bLefttheGroundThisFrame)
{
m_flLeftGroundHeight = record->m_origin.z;
}
if (m_bLandedOnGroundThisFrame)
{
m_flLeftGroundHeight = abs(m_flLeftGroundHeight - m_player->m_vecOrigin().z);
float flDistanceFallNormalizedBiasRange = math::Bias(math::SimpleSplineRemapValClamped(flDistanceFell, 12.0f, 72.0f, 0.0f, 1.0f), 0.4f);
state->m_flLandAnimMultiplier = std::clamp(math::Bias(state->m_flDurationInAir, 0.3f), 0.1f, 1.0f);
state->m_flDuckAdditional = std::max(state->m_flLandAnimMultiplier, flDistanceFallNormalizedBiasRange);
}
else
{
state->m_flDuckAdditional = math::ApproachAngle(0, state->m_flDuckAdditional, state->m_flLastUpdateIncrement * 2);
}
state->m_flInAirSmoothValue = math::ApproachAngle(state->m_bOnGround ? 1 : 0, state->m_flInAirSmoothValue, math::Lerp(state->m_flAnimDuckAmount, 8.f, 16.f) * state->m_flLastUpdateIncrement);
math::clamp(state->m_flInAirSmoothValue, 0.f, 1.f);