Function truncate

  • Ensure a vector is not longer than a max length

    Type Parameters

    Parameters

    • a: BaseArgType

      The vec2 to limit

    • maxLen: number

      The longest length of the resulting vector

    • Optional dst: T

    Returns T

    The vector, shortened to maxLen if it's too long