Class Vector2Curve

Animation spline represented by a set of keyframes, each representing an endpoint of a cubic hermite curve. The spline can be evaluated at any time, and uses caching to speed up multiple sequential evaluations.

Curves are expected to be immutable for threading purposes

Hierarchy

  • FrameworkObject
    • Vector2Curve

Constructors

Accessors

Methods

Constructors

  • Creates a new animation curve.

    Parameters

    • Optionalkeyframes: readonly Immutable<KeyFrameVec2>[]

      If TKeyframe<TVector2>: Keyframes to initialize the curve with. They must be sorted by time.

    • OptionalisInternalConstructor: boolean

    Returns Vector2Curve

Accessors

Methods

  • Evaluate the animation curve at the specified time. If evaluating multiple values in a sequential order consider using the cached version of evaluate() for better performance.

    Parameters

    • time: number

      %Time to evaluate the curve at.

    • Optionalloop: boolean

      If true the curve will loop when it goes past the end or beggining. Otherwise the curve value will be clamped.

    Returns Vector2

    Interpolated value from the curve at provided time.

  • Compares the current animation curve against another one.

    Parameters

    Returns boolean