Variable TuplesConst

Tuples: {
    add: ((a, b) => XYZ);
    distance: ((a, b) => number);
    fromCannon: ((value) => XYZ | XYZW);
    normalize: ((tuple) => XYZ);
    rgbColour255: ((r, g, b) => RGB);
    rgbColourHex: ((hexString) => RGB);
    scale: ((tuple, amount) => XYZ);
    scaleClamped: ((colour, amount) => RGB | RGBA);
    toVec3: ((tuple) => vec3);
} = ...

Type declaration

  • add: ((a, b) => XYZ)
  • distance: ((a, b) => number)
      • (a, b): number
      • Calculates the distance between two 3-tuples

        Parameters

        • a: XYZ

          First tuple

        • b: XYZ

          Second tuple

        Returns number

  • fromCannon: ((value) => XYZ | XYZW)
      • (value): XYZ | XYZW
      • Converts a Cannon.js vector or quaternion to a tuple

        Parameters

        • value: Quaternion | Vec3

          The Cannon.js vector or quaternion to convert

        Returns XYZ | XYZW

  • normalize: ((tuple) => XYZ)
      • (tuple): XYZ
      • Normalizes a 3-tuple to a unit vector.

        Parameters

        • tuple: number[] | XYZ | RGB

          The tuple to normalize

        Returns XYZ

  • rgbColour255: ((r, g, b) => RGB)
      • (r, g, b): RGB
      • Creates a RGB 3-tuple from 0-255 values.

        Parameters

        • r: number

          Red value (0-255)

        • g: number

          Green value (0-255)

        • b: number

          Blue value (0-255)

        Returns RGB

  • rgbColourHex: ((hexString) => RGB)
      • (hexString): RGB
      • Converts a hex string to an RGB 3-tuple.

        Parameters

        • hexString: string

        Returns RGB

  • scale: ((tuple, amount) => XYZ)
      • (tuple, amount): XYZ
      • Scales a 3-tuple by a scalar.

        Parameters

        • tuple: number[] | XYZ | RGB | RGBA

          The tuple to scale

        • amount: number

        Returns XYZ

  • scaleClamped: ((colour, amount) => RGB | RGBA)
      • (colour, amount): RGB | RGBA
      • Scales a 3-tuple by a scalar, clamping the result to 0-1.

        Parameters

        Returns RGB | RGBA

  • toVec3: ((tuple) => vec3)
      • (tuple): vec3
      • Converts a 3-tuple to a gl-matrix vec3

        Parameters

        • tuple: XYZ

          The tuple to convert

        Returns vec3

Generated using TypeDoc