spatial-controls - v6.2.0
    Preparing search index...

    Class ScalarDamper

    A scalar damper that retains velocity.

    Based on Game Programming Gems 4 Chapter 1.10.

    Index

    Constructors

    • Constructs a new scalar damper.

      Parameters

      • maxSpeed: number = Number.POSITIVE_INFINITY

        The maximum speed at which the value can change.

      Returns ScalarDamper

    Methods

    • Smooth interpolation with exponential velocity gain/decay.

      Parameters

      Returns number

      The interpolated value.

    • Calculates the exponentional factor which can be reused for interpolations during the same frame.

      Parameters

      Returns number

      The exponentional interpolation factor.

    • Calculates the Omega coefficient which can be reused for interpolations during the same frame.

      Parameters

      • lambda: number

        A smoothing factor.

      Returns number

      Omega.