mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-28 06:37:58 +03:00
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:
parent
8e283f3738
commit
b720ec4c84
@ -56,6 +56,9 @@ const float ATTACHED_DAMPING_SCALE = 50.0f;
|
|||||||
#define SF_RAGDOLLPROP_MOTIONDISABLED 0x4000
|
#define SF_RAGDOLLPROP_MOTIONDISABLED 0x4000
|
||||||
#define SF_RAGDOLLPROP_ALLOW_STRETCH 0x8000
|
#define SF_RAGDOLLPROP_ALLOW_STRETCH 0x8000
|
||||||
#define SF_RAGDOLLPROP_STARTASLEEP 0x10000
|
#define SF_RAGDOLLPROP_STARTASLEEP 0x10000
|
||||||
|
#ifdef MAPBASE
|
||||||
|
#define SF_RAGDOLLPROP_FIXED_CONSTRAINTS 0x20000
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Networking
|
// Networking
|
||||||
@ -758,7 +761,11 @@ void CRagdollProp::InitRagdoll( const Vector &forceVector, int forceBone, const
|
|||||||
params.pCurrentBones = pBoneToWorld;
|
params.pCurrentBones = pBoneToWorld;
|
||||||
params.jointFrictionScale = 1.0;
|
params.jointFrictionScale = 1.0;
|
||||||
params.allowStretch = HasSpawnFlags(SF_RAGDOLLPROP_ALLOW_STRETCH);
|
params.allowStretch = HasSpawnFlags(SF_RAGDOLLPROP_ALLOW_STRETCH);
|
||||||
|
#ifdef MAPBASE
|
||||||
|
params.fixedConstraints = HasSpawnFlags(SF_RAGDOLLPROP_FIXED_CONSTRAINTS);
|
||||||
|
#else
|
||||||
params.fixedConstraints = false;
|
params.fixedConstraints = false;
|
||||||
|
#endif
|
||||||
RagdollCreate( m_ragdoll, params, physenv );
|
RagdollCreate( m_ragdoll, params, physenv );
|
||||||
RagdollApplyAnimationAsVelocity( m_ragdoll, pPrevBones, pBoneToWorld, dt );
|
RagdollApplyAnimationAsVelocity( m_ragdoll, pPrevBones, pBoneToWorld, dt );
|
||||||
if ( m_anglesOverrideString != NULL_STRING && Q_strlen(m_anglesOverrideString.ToCStr()) > 0 )
|
if ( m_anglesOverrideString != NULL_STRING && Q_strlen(m_anglesOverrideString.ToCStr()) > 0 )
|
||||||
|
@ -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 ¶ms, solid_t &solid )
|
static void RagdollAddSolid( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragdoll, const ragdollparams_t ¶ms, solid_t &solid )
|
||||||
{
|
{
|
||||||
if ( solid.index >= 0 && solid.index < params.pCollide->solidCount)
|
if ( solid.index >= 0 && solid.index < params.pCollide->solidCount)
|
||||||
@ -186,7 +190,12 @@ static void RagdollAddSolid( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragdoll,
|
|||||||
{
|
{
|
||||||
if ( params.fixedConstraints )
|
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;
|
solid.params.mass = 1000.f;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
solid.params.rotInertiaLimit = 0.1;
|
solid.params.rotInertiaLimit = 0.1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user