$collisionmodel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
==$collisionmodel options==
The [[QC Command]] [[$collisionmodel]] is used to setup the physbox, collision hull, or [[collision model]].
{{note|[[Jointed collision model]]s use the [[QC Command]] [[$collisionjoints]] instead of [[$collisionmodel]].}}
* See also [[NPC Hull]].
* See also [[Physics and Ragdolls]].


$mass
* Manually set the mass of the model


  $automass
== Example Syntax==
* Tell the physics system to compute a mass for the model, based on it's surfaceprops & volume
  [[$collisionmodel]] "tree_deciduous_01a_physbox.smd"
{
    [[$mass]] 350.0
    [[$concave]]
}
* Straight after $collisionmodel you specify the name of the .SMD to use as a collision model.
* You should always create an efficient _physbox.smd rather than just using the _reference.smd as a collision model.


$inertia
==Options==
* Inertia scale


$damping
; [[$mass]] <kilograms>
* Linear damping scale
: 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.


$rotdamping
; [[$automass]]
* Rotational damping scale
: 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.


$drag
; [[$masscenter]] <X Y Z offset?>
* Scales the air resistance
: Override the center of mass, in local coords.


$concave
; [[$inertia]] <scale?>
* The vphysics collision model is not a single convex hull. If not set, it'll make a single convex hull out of whatever geometry you give it.  
: Inertia scale.


$masscenter
; [[$damping]] <scale?>
* Override the center of mass, in local coords
: Linear damping scale.


$jointskip
; [[$rotdamping]] <scale?>
* Rarely used. Eliminates a joint in the collision model that you don't want to use. (i.e. if you were using a render model as a ragdoll, and it has bones you don't want)
: Rotational damping scale.


$jointmerge
; [[$drag]] <scale?>
* Merges the vertex assignments for two joints.  
: Scales the air resistance.  


$rootbone
; [[$concave]]
* The parent-most bone that actually has collision geometry.  
: The vphysics [[collision model]] is made up of individual separate convex hulls (separate pieces), and not just one big hull. 
:* If not set, it'll make a single convex hull out of whatever geometry you give it.  


[[$jointconstrain]]
* The limits of the joint's movement
$jointinertia
* Like $inertia, but per-bone
$jointdamping
* Like $damping, but per-bone
$jointrotdamping
* Like $rotdamping, but per-bone
$jointmassbias
* 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
* If any $jointcollide pairs are specified, only those joints collide with each other.
$animatedfriction
* Used to animate the amount of friction on joints over time.


[[Category:QC Commands]]
[[Category:QC Commands]]

Revision as of 18:10, 30 March 2008

The QC Command $collisionmodel is used to setup the physbox, collision hull, or collision model.

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


Example Syntax

$collisionmodel "tree_deciduous_01a_physbox.smd"
{
    $mass 350.0
    $concave
}
  • Straight after $collisionmodel you specify the name of the .SMD to use as a collision model.
  • You should always create an efficient _physbox.smd rather than just using the _reference.smd as a collision model.

Options

$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.
$concave
The vphysics collision model is made up of individual separate convex hulls (separate pieces), and not just one big hull.
  • If not set, it'll make a single convex hull out of whatever geometry you give it.