@0b5vr/experimental
    Preparing search index...

    Class CDS

    The implementation of Critical Damped Spring (CDS).

    This is the very naive implementation. No deltaTime clamping or sub-stepping. You may want to do such improvement yourself if you need this to be more robust.

    Shoutouts to Keijiro Takahashi

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    factor: number = 100.0

    The factor (stiffness) of the spring. I recomment a value around 100 or 1000.

    ratio: number = 1.0

    The ratio (damping) of the spring. 1.0 == critical damping.

    target: number = 0.0

    The target value of the spring. You usually want to set this value to control the spring.

    value: number = 0.0

    The current value of the spring.

    velocity: number = 0.0

    The current velocity of the spring.

    Methods

    • Parameters

      • deltaTime: number

      Returns number