Spring and damper settings of a joint.

Constructor

new()

Default constructor.

Variables

dampingRatio:Float

The damping ratio of the constraint. Set 1.0 to make the constraint critically dumped.

frequency:Float

The frequency of the spring in Hz. Set 0.0 to disable the spring and make the constraint totally rigid.

useSymplecticEuler:Bool

Whether to use symplectic Euler method instead of implicit Euler method, to numarically integrate the constraint. Note that symplectic Euler method conserves energy better than implicit Euler method does, but the constraint will be unstable under the high frequency.

Methods

clone():SpringDamper

Returns a clone of the object.

setSpring(frequency:Float, dampingRatio:Float):SpringDamper

Sets spring and damper parameters at once and returns this. this.frequency is set to frequency, and this.dampingRatio is set to dampingRatio.

setSymplecticEuler(useSymplecticEuler:Bool):SpringDamper