Phys spring: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(in progress)
No edit summary
Line 6: Line 6:
==Keyvalues==
==Keyvalues==
*{{kv targetname}}
*{{kv targetname}}
Entity 1 attach1 <target_destination>  
*'''attach1''' <target_destination>  
 
*'''attach2''' <target_destination>  
Entity 2 attach2 <target_destination>  
*'''springaxis''' <[[vecline]]>  
 
:Use the helper. Drag it out to match the virtual spring.
Spring Axis springaxis <vecline> Use the helper. Drag it out to match the virtual spring.
*'''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 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.
*'''constant''' <float>  
 
:Stiffness of the spring.  The larger the number the less the spring will stretch.
Spring Constant constant <string> 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.
Damping Constant damping <string> 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.
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.
*'''breaklength''' <float>  
 
:If the spring's length ever exceeds this length, the spring breaks.
Break on Length breaklength <string> If the spring's length ever exceeds this length, the spring breaks.


==Flags==
==Flags==
*1 : Force only on stretch


INPUTS
==Inputs==
 
*{{i targetname}}
Kill Removes this entity from the world.
*'''SetSpringConstant''' <float>  
 
:Set the Spring Constant.
KillHierarchy Removes this entity and all its children from the world.
*'''SetSpringLength''' <float>  
 
:Set the Spring Length.
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
*'''SetSpringDamping''' <float>  
 
:Set the Spring Damping.
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetSpringConstant <float> Set the Spring Constant.
 
SetSpringLength <float> Set the Spring Length.
 
SetSpringDamping <float> Set the Spring Damping.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.


OnUser3 Fired in response to FireUser3 input.
==Outputs==
*{{o targetname}}


OnUser4 Fired in response to FireUser4 input.
[[Category:Entities]]

Revision as of 07:56, 4 October 2005

Template:Wrongtitle

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

Use the helper. Drag it out to match the virtual spring.
  • 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.
  • 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

Inputs

Set the Spring Constant.
  • SetSpringLength <float>
Set the Spring Length.
  • SetSpringDamping <float>
Set the Spring Damping.

Outputs