Phys constraintsystem: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
(transfered description from Physics Entity Overview)
Line 1: Line 1:
{{wrongtitle|title=phys_constraintsystem}}
{{base_point}} If you have a collection of objects connected by [[:Category:Constraints|constraints]], the constraint solvers may fight each other as they are each solved without regard to each other. You'll see this as vibration or jiggling.
{{base_point}}
 
To prevent this problem, you can create a phys_constraintsystem and have each object in a constraint group that group refer to it (by [[targetname]]) as their system manager. Those solvers will then be iterated as a group, which will create a feedback loop between the constraints so that interactions between them can be managed.


==Entity Description==
The constraint system also allows you to control the number of iterations, allowing you to allocate more CPU to get the solution tighter. This will help when objects of dissimilar mass are connected, as if a large-mass object is in violation of the constraint it will take more iterations for it to move to a non-violating position/orientation. [[Ragdoll]]s create a constraint system internally to solve these issues.
An entity used to manage a group of interacting [[constraint]]s and keep them stable. All constraints on a set of entities should be placed in the same system, or they will fight each other during simulation.


{{Note|This entity is a valid base entity but only appears in the halflife2.fgd}}
== Keyvalues ==


==Keyvalues==
*'''additionaliterations''' <[[int]]>
:Adding iterations makes the interactions among constraints in a system tighter.  It will not compensate for errors due to collision, but will help in cases where objects of disparate mass are constrained to each other.
*{{KV Targetname}}
*{{KV Targetname}}
*'''additionaliterations''' <integer>
:Adding iterations makes the interactions among constraints in a system tighter.  It will not compensate for errors due to collision, but will help in cases where objects of disparate mass are constrained to each other.


==Inputs==
==Inputs==
Line 17: Line 16:
==Outputs==
==Outputs==
*{{O Targetname}}
*{{O Targetname}}
{{wrongtitle|title=phys_constraintsystem}}
[[Category:Constraints]]

Revision as of 07:45, 13 June 2009

Template:Base point If you have a collection of objects connected by constraints, the constraint solvers may fight each other as they are each solved without regard to each other. You'll see this as vibration or jiggling.

To prevent this problem, you can create a phys_constraintsystem and have each object in a constraint group that group refer to it (by targetname) as their system manager. Those solvers will then be iterated as a group, which will create a feedback loop between the constraints so that interactions between them can be managed.

The constraint system also allows you to control the number of iterations, allowing you to allocate more CPU to get the solution tighter. This will help when objects of dissimilar mass are connected, as if a large-mass object is in violation of the constraint it will take more iterations for it to move to a non-violating position/orientation. Ragdolls create a constraint system internally to solve these issues.

Keyvalues

  • additionaliterations <int>
Adding iterations makes the interactions among constraints in a system tighter. It will not compensate for errors due to collision, but will help in cases where objects of disparate mass are constrained to each other.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

Outputs

Template:Wrongtitle