babylon.quarks - v1.0.0
    Preparing search index...

    Class ContinuousLinearFunction<T>

    A piecewise linear function over [0, 1] through keys: the alpha or colour keys of a Gradient. Before the first key it holds the first value, after the last the last.

    Build number keys directly. Vector and colour keys hold quarks' internal math: build a gradient's colour keys through the Gradient constructor, which takes Color3Like, and read or edit existing keys in place.

    Type Parameters

    • T extends number | Vector3 | Vector4
    Index
    keys: [T, number][]

    The keys as [value, position], sorted by position.

    What the values are, for the JSON.

    type: "function"

    Always 'function'.

    • The key whose span holds t: -1 before the first key, the last key from its position on (so a t past 1 holds the final value, as the sampled table does).

      Parameters

      • t: number

      Returns number

    • The value at t: a number, or written into the object value and returned.

      Parameters

      • value: T
      • t: number

      Returns T

    • The position of the key after index, or 1 for the last.

      Parameters

      • index: number

      Returns number

    • The position of key index.

      Parameters

      • index: number

      Returns number