Function SpringFrame

  • Generates a single frame of the spring easing at a specific time between (0 to 1) with the spring parameters given [mass, stiffness, damping, velocity]

    Parameters

    • t: number

      time value between 0 & 1

    • Optional spring-parameters: number[]

      (limit of 0.0001 to 1)

      • mass = mass of object
      • stiffness = stiffness of spring
      • damping = amount to dampen spring motion
      • velocity = initial velocity of spring
    • Optional duration: number

      (optional) the maximum duration (in milliseconds) required for a spring (with its specified spring parameters) to reach a resting position. It's used to ensure the progress of all spring frames put together are smooth

    Returns number

    a single frame of the spring easing at the time specified

    Note: Be very careful of only setting some of the spring parameters, it can cause errors if you are not careful

    Based on animejs

Generated using TypeDoc