• Smoothens a current value based on velocity while reducing the velocity.

    Parameters

    • current: number

      the current value

    • velocity: number

      the current velocity of the value

    • smoothTime: number

      the time it should take to smoothen the velocity to 0

    • deltaTime: number

      the amount of time passed since last frame

    Returns [number, number]

    the smoothened value and new velocity: [position, velocity]