$jointconstrain: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(clean up)
Line 1: Line 1:
== Usage ==
The [[QC Command]] [[$jointconstrain]] is used to set the limit of a joint's movement when compiling the [[$collisionmodel]].
<code>$jointconstrain (Name) (Axis) (Type) (MinRange) (MaxRange) (Friction)</code>


A [[QC command]] used to set the limit of a joint's movement when compiling the [[collision model]]. For example, to limit ''joint_spine'' on the X axis with a range from 20 to 100 and a set friction of 0.20, add this line to the [[qc|.QC]] file: <code>$jointconstrain "joint_spine" x limit 20.00 100.00 0.20</code>.
== Syntax ==
$jointconstrain <bone_name> <axis> <allow_option> <min_angle> <max_angle> <friction>
where
; <bone_name> : {{todo|is the name of the 'child' bone as opposed to the 'parent' bone of the joint? - see example}}.
; <axis> : specifies either the X, Y, or Z axis of rotation.
; <allow_option> : can be one of three values:
:* '''Free''' : ensures the joint can move between a <min_angle> of -360 and a <max_angle> of 360, with a selectable <friction>. Ignores user specified <min_angle> and <max_angle> values.
:* '''Fixed''' : ensures the joint does not move at all. <min_angle>, <max_angle> and <friction> values are effectively locked to "0".
:* '''Limit''' : ensures the joint is completely customizable. The user must specify <min_angle>, <max_angle> and <friction> values.  
; <min_angle> : specifies the minimum angle of rotation about <axis> in degrees. (No lower than -360).
; <max_angle> : specifies  the maximum angle of rotation about <axis> in degrees. (No higher than 360).
; <friction> : specifies the Friction value {{todo|scale? integer?}}.


== Parameters ==
=== Example ===


=== Name ===
For example, to constrain the movement of ''joint_spine'' within a range of 20 to 100 degrees on the X-axis, with a friction of 0.20:
: Name of the bone.
$jointconstrain "joint_spine" x limit 20.00 100.00 0.20.


=== Axis ===
: X, Y, or Z.


=== Type ===
[[Category:QC Commands]]
* '''Free'''
: The joint can move between a MinRange of -360 and a MaxRange of 360 with a selectable Friction. Note that user specified MinRange and MaxRange values are ignored.
* '''Fixed'''
: The joint does not move at all. The MinRange, MaxRange, and Friction values are locked at 0.
* '''Limit'''
: The joint is completely customizable. The user must specify MinRange, MaxRange, and Friction values.
 
=== MinRange ===
: If allowed, sets the minimum range allowed for this joint in degrees. (No lower than -360)
 
=== MaxRange ===
: If allowed, sets the maximum range allowed for this joint in degrees. (No higher than 360)
 
=== Friction ===
: If allowed, sets the Friction value.
 
== See also ==
* [[QC Commands]]
 
[[Category:Modeling]]

Revision as of 15:41, 30 March 2008

The QC Command $jointconstrain is used to set the limit of a joint's movement when compiling the $collisionmodel.

Syntax

$jointconstrain <bone_name> <axis> <allow_option> <min_angle> <max_angle> <friction>

where

<bone_name>
Todo: is the name of the 'child' bone as opposed to the 'parent' bone of the joint? - see example
.
<axis>
specifies either the X, Y, or Z axis of rotation.
<allow_option>
can be one of three values:
  • Free : ensures the joint can move between a <min_angle> of -360 and a <max_angle> of 360, with a selectable <friction>. Ignores user specified <min_angle> and <max_angle> values.
  • Fixed : ensures the joint does not move at all. <min_angle>, <max_angle> and <friction> values are effectively locked to "0".
  • Limit : ensures the joint is completely customizable. The user must specify <min_angle>, <max_angle> and <friction> values.
<min_angle>
specifies the minimum angle of rotation about <axis> in degrees. (No lower than -360).
<max_angle>
specifies the maximum angle of rotation about <axis> in degrees. (No higher than 360).
<friction>
specifies the Friction value
Todo: scale? integer?
.

Example

For example, to constrain the movement of joint_spine within a range of 20 to 100 degrees on the X-axis, with a friction of 0.20:

$jointconstrain "joint_spine" x limit 20.00 100.00 0.20.