Type alias TypeFrameFunction

TypeFrameFunction: ((t: number, [mass, stiffness, damping, velocity]?: number[], duration?: number) => number)

Type declaration

    • (t: number, [mass, stiffness, damping, velocity]?: number[], duration?: number): number
    • The format to use when defining custom frame functions An example of a frame function is SpringFrame

      Source

      Source code of TypeFrameFunction

      Returns

      a single frame of the frame function 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

      Parameters

      • t: number

        time value between 0 & 1

      • Optional [mass, stiffness, damping, velocity]: number[]
      • 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

Generated using TypeDoc