From Valve Developer Community
Revision as of 16:13, 7 October 2008 by Coder0xff (talk | contribs) (Options: modified $animatedfriction based on in-the-wild examples)
Jump to: navigation, search

The QC command $collisionjoints is used to define a jointed collision model for a ragdoll. A jointed collision model is used by VPhysics to detect collisions and animate the model's Skeleton accordingly. The main parameter is the name of the physbox.smd or ragdoll.smd file containing this model's skeletal and collision geometry. The Rigging parameters configure the way the skeletal joints respond to Vphysics forces.

Tip.png Tip: Use vcollide_wireframe 1 to view collision meshes in-game.
Tip.png Tip: If your model has no moving parts that need to collide, use $collisionmodel.
Warning.png Warning: Collision meshes should be extremely low-poly in comparison to reference meshes, and even lod meshes. See collision mesh.


$collisionjoints <collision mesh SMD>


All $collisionmodel options, except $concave
This type of collision mesh is always concave...otherwise how could it be animated?
$rootbone <string|bone>
Overrides the SMD's root bone.
To do: Purpose.
$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.
To do: Difference from a $weightlist.
Disables collisions between bones in the same collision model for performance.
Warning.png 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.
$animatedfriction <float|?> <float|?> <float|?> <float|?> <float|?>
Used to animate the amount of friction on joints over time.


$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

See also