Skip to content

SpringPhysicsRigPoseModifierData

Class Documentation

Edit documentation

A pose modifier that makes one joint lag behind the motion of the unit and swing back, as a spring. It is the simple form of secondary motion. For chains of joints with gravity and collision, see DynamicsChainRigPoseModifierData.

The spring does not look at the animation. Its only input is how the unit itself moved and turned since the last frame:

  • DoTranslation. When the unit moves, the joint is left behind by the distance moved, and a spring pulls that offset back to zero.
  • DoRotation. When the unit turns, the joint is turned back by the angle turned, around the vertical axis, and a spring pulls that angle back to zero.

The spring force on each frame is -(SpringStiffness / Mass) * offset - (Damping / Mass) * velocity. The offset, or the angle, is added to the animated transform of the joint.

A SpringPhysicsEventData on a clip turns a spring on or off while the event is active.

Properties

DefaultOn

Bool = true
Edit documentation

True: the spring is on, and an event turns it off. False: the spring is off, and an event turns it on.

DoRotation

Bool = false
Edit documentation

Makes the rotation of the joint lag behind the turning of the unit, around the vertical axis. False by default.

DoTranslation

Bool = false
Edit documentation

Makes the position of the joint lag behind the movement of the unit. False by default.

Invert

Bool = false
Edit documentation

Applies the offset and the angle in the opposite direction, so the joint leads the motion of the unit in place of lagging behind it.

Joint

Hash = "0x0"
Edit documentation

The joint the spring moves, as the hash of its name (FNV-1a 32 of the lowercased name). A name that is not a joint of the skeleton makes the spring do nothing.

Mass

F32 = 0.10000000149011612
Edit documentation

The mass on the spring. The stiffness and the damping are both divided by it, so a higher mass makes the joint swing slower and settle later.

SpringStiffness

F32 = 2.5
Edit documentation

How strongly the joint is pulled back to its animated place. A higher value swings faster.

maxAngle

F32 = 0
Edit documentation

The largest angle of the joint, in degrees. It works the same as maxDistance. 0 sets no limit.

maxDistance

F32 = 0
Edit documentation

The largest offset of the joint, in world units. An offset beyond it is cut to just below the limit and the spring loses its velocity. 0, which is the default, sets no limit.