phys_spring

From Valve Developer Community

Revision as of 03:09, 20 January 2009 by VDCBot (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a point entity available in all Source games.

Contents

Entity Description

A physically simulated spring. length is what's known as the "natural spring length". This is how long the spring would be if it was at rest (nothing hanging on it or attached). When you attach something to the spring, it will stretch longer than its natural length. The amount of stretch is determined by the spring constant constant. The larger the spring constant the less stretch in the spring.

Keyvalues

  • Targetname:

Name <string>
The targetname other entities refer to this entity by.
  • attach1
<target_destination>
  • attach2
<target_destination>
  • springaxis
<vecline> Use the helper. Drag it out to match the virtual spring.
  • length
<float> How long the spring would be if it was at rest (nothing hanging on it or attached). 0 means the length of the brush.
  • constant
<float> Stiffness of the spring. The larger the number the less the spring will stretch.
  • damping
<float> Damping constant: how much energy the spring loses. The larger the number, the less bouncy the spring.
  • relativedamping
<float> Relative damping constant: the amount of energy the spring loses proportional to the relative velocity of the two objects the spring is attached to.
  • breaklength
<float> If the spring's length ever exceeds this length, the spring breaks.

Flags

  • 1 : Force only on stretch - This flag will make the spring act like a bungee cord or springy rope.

Inputs

  • Targetname:

Kill
Removes this entity from the world.
KillHierarchy
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 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
  • SetSpringConstant <float>
Set the Spring Constant.
  • SetSpringLength <float>
Set the Spring Length.
  • SetSpringDamping <float>
Set the Spring Damping.

Outputs

  • Targetname:

OnUser1 to OnUser4
Fired in response to the FireUser inputs; see User Inputs and Outputs.
OnKilled (New with Left 4 Dead)
Fired when the entity is killed and removed from the game.
Personal tools