Moderator elections are being held. See Valve Developer Community:Moderator elections for more details.
Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.
Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.
$collisionjoints
Contents
$collisionjoints
is a QC command available in all Source games. It is used to define a collision mesh made up of multiple independent parts, either for a ragdoll or for an animated object. If your model has no moving parts that need to collide, use
$collisionmodel
instead.
A ragdoll can have up to 32 separate parts (i.e. 32 bones can be simulated, 24 on older versions of Source). The limit for an animated model is 99 separate parts.
![Tip.png](/w/images/thumb/4/45/Tip.png/9px-Tip.png)
vcollide_wireframe 1
to view collision meshes in-game.![Warning.png](/w/images/thumb/c/cb/Warning.png/10px-Warning.png)
![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
bone_followers
section under $keyvalues, for example:
$keyvalues
{
bone_followers
{
"bone" "mycoolbone"
}
}
Syntax
$collisionjoints <collision mesh SMD/DMX> { <options> }
Options
- All
$collisionmodel
options, except$concave
Confirm:Is $masscenter allowed?
- $concaveperjoint
- Permit concave collision geometry for individual bones.
- $rootbone <string|bone>
- Overrides the collision mesh's root bone.
- $jointskip <string|bone>
- Eliminates a joint in the skeleton that you don't want to use in collisions.
$jointmerge <string|bone1> <string|bone2>
- Merges the vertex assignments for two joints.
$jointconstrain <string|bone> <axis> <allow_option> <min_angle> <max_angle> <friction>
- Limits of the a bone's movement relative to its parent bone. See $jointconstrain for a full description.
$jointinertia <string|bone> <float|scale>
- Per-bone
$inertia
. $jointdamping <string|bone> <float|scale>
- Per-bone
$damping
. $jointrotdamping <string|bone> <float|scale>
- Per-bone
$rotdamping
. $jointmassbias <string|bone> <float|bias>
- Mass is automatically distributed by volume, this lets you bias it per-bone.
$noselfcollisions
- Disables collisions between bones in the same collision model for performance.
Warning:Results in arms clipping through torsos and other weirdness if used improperly!
$jointcollide <string|bone1> <string|bone2>
- If any
$jointcollide
pairs are specified, only those joints collide with each other. Bug:Does not work in Left 4 Dead or Left 4 Dead 2, instead disabling self collisions entirely.
$animatedfriction <float|FrictionTimeIn> <float|FrictionTimeOut> <float|FrictionTimeHold> <float|MinAnimatedFriction> <float|MaxAnimatedFriction>
- Used to animate the amount of friction on joints over time. This can be used to make character death ragdolls tense up.
Bug:Only works on C_ClientRagdoll entity, does not work on traditional player death ragdolls or serverside ragdolls.
Example
$collisionjoints "bip01_phys.smd"
{
$mass 115.0
$inertia 2.00
$damping 0.01
$rotdamping 0.40
$rootbone "bip01_pelvis"
$jointmerge "bip01_pelvis" "bip01_spine"
$jointmassbias "bip01_l_arm2" 2.00
$jointconstrain "bip01_l_arm2" x limit 0.00 0.00 0.00
$jointconstrain "bip01_l_arm2" y limit 0.00 0.00 0.00
$jointconstrain "bip01_l_arm2" z limit -120.00 4.00 0.20
$jointrotdamping "bip01_head" 5.00
$jointconstrain "bip01_head" x limit -20.00 20.00 0.00
$jointconstrain "bip01_head" y limit -25.00 25.00 0.04
$jointconstrain "bip01_head" z limit -13.00 30.00 0.04
}