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

Phys spring: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Updated to use "this is a" template)
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.)
Line 1: Line 1:
{{this is a|e0|name=phys_spring|engine=2}} It is 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.
{{this is a|point entity|name=phys_spring|engine=Source}} It is 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 ==
== Keyvalues ==

Revision as of 16:49, 17 May 2024

phys_spring is a point entity available in all Source Source games. It is 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

Entity 1 (attach1) <targetname>
First entity to attach.
Entity 2 (attach2) <targetname>
Second entity to attach.
Spring Axis (springaxis) <vector>
Use the helper. Drag it out to match the virtual spring.
Spring Length (length) <string>
How long the spring would be if it was at rest (nothing hanging on it or attached). 0 means the length of the brush.
Spring Constant (constant) <string>
Stiffness of the spring. The larger the number the less the spring will stretch.
Damping Constant (damping) <string>
How much energy the spring loses. The larger the number, the less bouncy the spring.
Relative Damping Constant (relativedamping) <string>
The amount of energy the spring loses proportional to the relative velocity of the two objects the spring is attached to.
Break on Length (breaklength) <string>
If the spring's length ever exceeds this length, the spring breaks.
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

Flags

  • 1 : Force only on stretch

Inputs

SetSpringConstant <floatRedirectInput/float>
Set the Spring Constant.
SetSpringLength <floatRedirectInput/float>
Set the Spring Length.
SetSpringDamping <floatRedirectInput/float>
Set the Spring Damping.


Outputs