smoothDamp
Gradually changes a value towards a target value over time. The smoothing function uses a spring-damping algorithm based on Game Programming Gems 4 Chapter 1.10.
Return
An object containing the new value and the updated current velocity.
Parameters
The current value.
The target value.
The current velocity.
The time since the last call to this function. Value must be greater than or equal to 0.0. Default value - 0.0
Optionally allows clamping to the specified maximum speed. Default value - Number.POSITIVE_INFINITY
Approximately the time it will take to reach the target. A smaller value will reach the target faster. This value must be greater than or equal to 0.0001. Default value - 0.0001
An object to store the result. If not provided, a new object will be created and returned.