This article's documentation is for anything that uses the Source engine. Click here for more information.

$autocenter: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
The [[QC command]] [[$autocenter]] moves the model so that its [[$origin]] is at the center of its [[bounding box]].
{{This is a|name=$autocenter|QC command}} It aligns the model's [[$origin]] to the center of its [[bounding box]] and creates an [[attachment point]] called "placementOrigin" where its origin used to be.
* It also adds an [[attachment point]] called "placementOrigin" which is the offset to the original origin.
* This could be useful when [[Creating custom gibs]], to ensure that each gib has a sensible ModelOrigin (center) for [[$illumposition|lighting]], [[$masscenter|collision]], etc. but spawns in the correct position relative to its parent breakable model. Simply model the gibs as a cluster - in their spawn positions, then export each gib separately and add <code>$autocenter</code> to each gib's QC file. Unfortunatelly, $autocenter only works on prop_static{{clarify}}.
* This is useful for [[building gibs]] so they have reasonable origins (centered) for lighting, bboxes, etc and spawn in the correct position when the parent model breaks. Simply model the gibs in XSI as a collection - where you'd want them to be placed, then export them separately and add $autocenter to each gib's QC file.


==Example Syntax==
== Syntax ==
{{todo|$autocenter syntax}}
$autocenter
 
[[Category:QC Commands]]

Latest revision as of 21:06, 16 July 2025

$autocenter is a QC command available in all Source Source games. It aligns the model's $origin to the center of its bounding box and creates an attachment point called "placementOrigin" where its origin used to be.

  • This could be useful when Creating custom gibs, to ensure that each gib has a sensible ModelOrigin (center) for lighting, collision, etc. but spawns in the correct position relative to its parent breakable model. Simply model the gibs as a cluster - in their spawn positions, then export each gib separately and add $autocenter to each gib's QC file. Unfortunatelly, $autocenter only works on prop_static[Clarify].

Syntax

$autocenter