$collisionjoints: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{stub}}
{{stub}}
The [[QC Command]] [[$collisionjoints]] is used to setup the ragdoll or [[jointed collision model]].  
The [[QC command]] [[$collisionjoints]] is used to setup the ragdoll or [[jointed collision model]].  
{{note|[[Jointed collision model]]s use the [[QC Command]] [[$collisionjoints]] instead of [[$collisionmodel]].}}
{{note|[[Jointed collision model]]s use [[$collisionjoints]] instead of [[$collisionmodel]].}}
* See also [[Physics and Ragdolls]].
* See also [[Physics and Ragdolls]].


Line 32: Line 32:
; [[$automass]]  
; [[$automass]]  
: Automatically compute the mass of the model.
: Automatically compute the mass of the model.
:* Derived from the density/thickness of the material defined in [[$surfaceprops]] and/or [[prop_data]] and the volume of the [[$collisionmodel]] itself.
:* Derived from the density/thickness of the material defined by [[$surfaceprop]] and/or [[Prop Data|prop_data]] and the volume of the [[$collisionmodel]] itself.


; [[$masscenter]] <X Y Z offset?>
; [[$masscenter]] <X Y Z offset?>

Revision as of 20:08, 30 March 2008

Stub

This article or section is a stub. You can help by expanding it.

The QC command $collisionjoints is used to setup the ragdoll or jointed collision model.

Note.pngNote:Jointed collision models use $collisionjoints instead of $collisionmodel.

Example Syntax

$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
}

General Parameters

$mass <kilograms>
Manually set the mass, in kilograms, of the model.
  • This is applicable when the object is a physics prop, rather than simply a static prop. Make certain to set this correctly, otherwise your object will behave unrealistically.
$automass
Automatically compute the mass of the model.
$masscenter <X Y Z offset?>
Override the center of mass, in local coords.
$inertia <scale?>
Inertia scale.
$damping <scale?>
Linear damping scale.
$rotdamping <scale?>
Rotational damping scale.
$drag <scale?>
Scales the air resistance.

Joint Parameters

$rootbone <bone_name?>
The parent-most bone that actually has collision geometry.
$jointskip <bone_name?>
Eliminates a joint in the collision model that you don't want to use. (Rarely used.)
  • (eg: if you were using a render model as a ragdoll, and it has bones you don't want)
$jointmerge <bone_name1> <bone_name2>
Merges the vertex assignments for two joints.
$jointconstrain <bone_name> <axis> <allow_option> <min_angle> <max_angle> <friction>
Limits of the a bone's movement relative to its parent bone.
$jointinertia <scale?>
Like $inertia, but per-bone.
$jointdamping <scale?>
Like $damping, but per-bone.
$jointrotdamping <scale?>
Like $rotdamping, but per-bone.
$jointmassbias <bone_name?> <value?>
Mass is automatically distributed by volume, this lets you bias it per-bone.
$noselfcollisions
Turns off all collisions between bones in this model, usually for performance.
$jointcollide <bone_name1?> <bone_name2?>
If any $jointcollide pairs are specified, only those joints collide with each other.
$animatedfriction <animation_name?>
Used to animate the amount of friction on joints over time.