Phys spring (Source 2): Difference between revisions
Jump to navigation
Jump to search
(Create source 2 phys_spring page from CS2 fgd) |
No edit summary |
||
Line 3: | Line 3: | ||
== Keyvalues == | == Keyvalues == | ||
{{KV Targetname}} | |||
{{KV|Entity 1|intn=attach1|target_destination|First entity to attach.}} | {{KV|Entity 1|intn=attach1|target_destination|First entity to attach.}} | ||
{{KV|Entity 2|intn=attach2|target_destination|Second entity to attach.}} | {{KV|Entity 2|intn=attach2|target_destination|Second entity to attach.}} | ||
Line 9: | Line 10: | ||
{{KV|Frequency|intn=frequency|string|The stiffness of the spring. The larger the number the less the spring will stretch. The maximum should be not more than 30!}} | {{KV|Frequency|intn=frequency|string|The stiffness of the spring. The larger the number the less the spring will stretch. The maximum should be not more than 30!}} | ||
{{KV|Damping Constant|intn=damping|string|How much energy the spring loses. The larger the number, the less bouncy the spring.}} | {{KV|Damping Constant|intn=damping|string|How much energy the spring loses. The larger the number, the less bouncy the spring.}} | ||
== Flags == | == Flags == | ||
Line 15: | Line 15: | ||
== Inputs == | == Inputs == | ||
{{ | {{I|SetRestLength|Set the spring rest length.|param=float}} | ||
{{ | {{I|SetFrequency|Set the spring frequency (stiffness).|param=float}} | ||
{{ | {{I|SetDampingRatio|Set the spring damping ratio.|param=float}} | ||
[[Category:Constraints|C]] | [[Category:Constraints|C]] |
Latest revision as of 11:07, 26 September 2024
phys_spring
is a point entity available in all Source 2 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 Frequency. The larger the spring frequency the less stretch in the spring.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- 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.
- Frequency (frequency) <string>
- The stiffness of the spring. The larger the number the less the spring will stretch. The maximum should be not more than 30!
- Damping Constant (damping) <string>
- How much energy the spring loses. The larger the number, the less bouncy the spring.
Flags
- 1 : Force only on stretch
Inputs
- SetRestLength <float >
- Set the spring rest length.
- SetFrequency <float >
- Set the spring frequency (stiffness).
- SetDampingRatio <float >
- Set the spring damping ratio.