Skip to content

Instantly share code, notes, and snippets.

@sigsegv-mvm
Created September 19, 2016 20:36
Show Gist options
  • Save sigsegv-mvm/b9e93b9d452edfbafb555bed024d7902 to your computer and use it in GitHub Desktop.
Save sigsegv-mvm/b9e93b9d452edfbafb555bed024d7902 to your computer and use it in GitHub Desktop.
Airblast impulse magnitude
// this function either does not really exist or is consistently inlined
// the logic comes from CTFFlameThrower::DeflectPlayer, shortly before the call to CTFPlayer::ApplyAirBlastImpulse
float CalculateAirblastImpulseMagnitude(CTFPlayer *pVictim)
{
// OBBSize() = m_vecMaxs - m_vecMins
Vector vecSize = pVictim->CollisionProp()->OBBSize();
return (float)(188928.0 / (vecSize.x * vecSize.y * vecSize.z) * 360.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment