$collisionmodel

From Valve Developer Community
Revision as of 20:06, 30 March 2008 by Beeswax (talk | contribs)
Jump to navigation Jump to search

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

Note.pngNote:Jointed collision models use $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.