User:CodingAintFun/pagetest00: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{CD|CPhysConstraintSystem|file1=physconstraint.cpp}}
{{CD|CKeepUpright|file1=phys_controller.cpp}}
{{this is a|e0|name=phys_constraintsystem|engine=2}} If you have a collection of objects connected by [[:Category:Constraints|constraints]], you may encounter vibration or jiggling. This is because each constraint is solved without regard for any others until you introduce a '''phys_constraintsystem'''.
{{this is a|e0|name=phys_keepupright|engine=2}} It is a controller that tries to keep an entity facing a particular direction.


To implement a phys_constraintsystem create one and give it a name, then select the constraints you want to group together and set it as their "Constraint System Manager".
== Keyvalues ==
{{KV|Target Entity|intn=attach1|target_destination|The entity to align to the desired angles.}}
{{KV|Angular Limit|intn=angularlimit|float|The maximum angular velocity that this controller can compensate for, in degrees per second.}}
{{KV Targetname}}
{{KV Angles}}


A constraintsystem also allows you to control the number of iterations performed on the constraints, 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.
== Flags ==
{{fl|1|Start inactive}}


== Keyvalues ==
== Inputs ==
{{KV|Additional System Iterations|intn=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.}}
{{IO|TurnOn|Enable the controller.}}
{{KV Targetname}}
{{IO|TurnOff|Disable the controller.}}


[[Category:Constraints|C]]
[[Category:Constraints|C]]

Revision as of 07:26, 16 December 2023

C++ Class hierarchy
CKeepUpright
CPointEntity
CBaseEntity
C++ phys_controller.cpp

phys_keepupright is an e0 available in all Template:2 games.Template:2 topicon

Warning.pngWarning:
  • The {{{engine}}} parameter is inconsistent with the name defined by the {{2}} template.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

It is a controller that tries to keep an entity facing a particular direction.

Keyvalues

Target Entity (attach1) <targetname>
The entity to align to the desired angles.
Angular Limit (angularlimit) <float>
The maximum angular velocity that this controller can compensate for, in degrees per second.
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

Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Flags

Start inactive : [1]

Inputs

TurnOn
Enable the controller.
TurnOff
Disable the controller.