Added spawnflag to make prop_ragdoll bones use constraints which are fixed to each other (also known as "make statue")

This commit is contained in:
Blixibon
2021-01-23 09:32:28 -06:00
parent 8e283f3738
commit b720ec4c84
2 changed files with 16 additions and 0 deletions

View File

@@ -174,6 +174,10 @@ void RagdollSetupAnimatedFriction( IPhysicsEnvironment *pPhysEnv, ragdoll_t *rag
}
}
#ifdef MAPBASE
ConVar g_ragdoll_fixed_constraints_mass( "g_ragdoll_fixed_constraints_mass", "1000", FCVAR_REPLICATED );
#endif
static void RagdollAddSolid( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragdoll, const ragdollparams_t &params, solid_t &solid )
{
if ( solid.index >= 0 && solid.index < params.pCollide->solidCount)
@@ -186,7 +190,12 @@ static void RagdollAddSolid( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragdoll,
{
if ( params.fixedConstraints )
{
#ifdef MAPBASE
if (g_ragdoll_fixed_constraints_mass.GetFloat() != -1)
solid.params.mass = g_ragdoll_fixed_constraints_mass.GetFloat();
#else
solid.params.mass = 1000.f;
#endif
}
solid.params.rotInertiaLimit = 0.1;