Mass-Spring

A MassSpring Behavior (beMassSpring) adds inertia to one, or several, bone chain(s), according to some spring and damping coefficients.

A MassSpring Behavior in the Behavior Editor

This behavior generates an acceleration on the end bone, on which IK is applied. It is computed according to this formula (mass is considered to be integrated in the coefficients) :

acceleration = spring * (current behavior position - posture input position) - damping * current behavior 3D speed;

Creation

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeMassSpring Node
  • MEL command: glmCrowdBeMassSpringCmd;


Two horses walking, the one on the foreground also have a MassSpring behavior on the tail

Configuration

A MassSpring Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

MassSpring Attributes

Spring Stiffness

The spring stiffness. Higher stiffness leads to more rigid behaviors.

Damping The damping coefficient, which must always be less than the spring stiffness (or resonance will occur). Higher damping avoids oscillations, whereas lower damping allows them.
Weight If several MassSpring Behaviors are active on the same bone chain, this defines the weight to blend them.
Bone Name

The name of the bone chain ending bone.

Bone Count The number of generic skeleton bone count, or bone chain count, impacted by the effect: an auxiliary chain count as 1, an extension chain too. See Converting Skeletons for more information.

Starting / Stopping Duration Attributes

The Starting / Stopping Duration value determines the time (in seconds) during which the mass spring effect goes from inactive to fully active (or vice versa). This time can be used to transition smoothly between two behaviors.

Starting / Stopping Duration Mode

This attribute allows a choice of two modes :

  • Random: Randomly set the Starting / Stopping Duration value between the specified "Starting / Stopping Duration Min" and "Starting / Stopping Duration Max" bounds (this attribute is influenced by the random seed of the Crowd Manager)
  • Per-Particle Attribute: Use the "Starting / Stopping Duration Name" attribute to get the name of the float per-particle field of the relative particle system, containing the Start Percent value.

The Starting / Stopping Duration value is in seconds.

Starting / Stopping Duration Min See Random option of the Starting / Stopping Duration Mode above
Available only when the Starting / Stopping Duration Mode is set to "Random"
Starting / Stopping Duration Max See Random option of the Starting / Stopping Duration Mode above
Available only when the Starting / Stopping Duration Mode is set to "Random"
Starting / Stopping Durationpp Name Name of the float per-particle field of the relative particle system, containing the Starting / Stopping Duration Mode value which will be used (for more explanation about how to use ppAttributes, see ppAttributes Handling)
Starting / Stopping Duration value is set to 0 if the ppAttribute name is empty or invalid
Available only when the Starting / Stopping Duration Mode is set to "Per-Particle Attribute"