Phys hinge
From Valve Developer Community
This point-based entity is available in all Source games.
| Table of contents |
Entity Description
A physically simulated hinge, rotating entities around an axis. The axis is the line between the actual point entity and its origin as set in hammer, although it can also be set using the helper. This allows for, essentially, an infinite number of usable axes.
Example: If the origin of a phys_hinge were to be dragged directly above the entity itself, the hinge axis would be a vertical line. If dragged to the side of the entity, the axis would be horizontal in whichever direction the origin were placed.
An entity can be set to rotate around a fixed point in the world by entering its name either in the attach1 (Entity 1) or the attach2 (Entity 2) keyvalue. It can also be set to rotate around another entity by specifying both of these fields, potentially creating a hinge that can be moved around in the world.
To set how tight these two objects will hinge together, you can apparently alter the Mass Scale keyvalue of the constrained entities. (If you come up with a better idea on how to do this, please add it.)
Keyvalues
- targetname <target_source>
- Defines the name that other entities refer to this entity by.
- hammerid [Episode Two Update]
- <integer readonly> This id is used for debugging purposes in Hammer.
- attach1
- <target_destination> Entity 1
- attach2
- <target_destination> Entity 2
- constraintsystem
- <target_destination> The name of a phys_constraintsystem that this constraint should be a part of. All constraints on a set of entities should be placed in the same system, or they will fight each other during simulation.
- forcelimit
- <float> The amount of force an impact must apply to the constraint to break it. A way of calculating this is to set it to the mass of an object that would break this constraint if it were resting on the constrainted objects. Set to zero for infinite strength.
- torquelimit
- <float> (lbs*distance) The amount of torque required to break the constraint. A way of calculating this is to multiply any reference mass by the resting distance (from the center of mass of the object) needed to break the constraint (1 lb = 453.59237 grams). Set to zero for infinite strength.
- breaksound
- <sound> A sound played when the constraint is broken.
- hingefriction
- <float> Resistance/friction in the hinge
- hingeaxis
- <vecline>
- SystemLoadScale
- <float> Scale of the load connected to this hinge (1=just the objects directly connected)
Flags
- 1 : No Collision until break
- 4 : Start inactive
- 8 : Change mass to keep stable attachment to world
Inputs
- Kill
- Removes this entity from the world.
- Removes this entity and all its children from the world.
- AddOutput <string>
- Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
- Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
- Break
- Force the constraint to break.
- TurnOn
- Enable the constraint. Do this when the objects don't exist when the constraint spawns - or when you have deactivated the constraint. Broken constraints can NOT be turned on. They have been deleted.
- TurnOff
- Disable this constraint.
- ConstraintBroken [Episode Two Update]
- SetAngularVelocity <float>
- Set angular velocity around the hinge (motor)
Outputs
- Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
- !activator = activator
- OnBreak
- Fired when the constraint breaks.
