Cluster Creator Kit Script Reference
    Preparing search index...

    Class Vector4

    A 4-dimensional vector.

    Methods that manipulate values are generally destructive. To preserve the original values, explicitly call clone() to create a duplicate instance.

    Index

    Constructors

    Properties

    w x y z

    Methods

    Constructors

    • Creates an instance with all components initialized to 0.

      Returns Vector4

    • Creates an instance with the specified x, y, z, and w component values.

      Parameters

      • x: number

        x component

      • y: number

        y component

      • z: number

        z component

      • w: number

        w component

      Returns Vector4

    Properties

    w: number
    x: number
    y: number
    z: number

    Methods

    • Compares the vector to v, and returns true if they are approximately equal.

      Parameters

      Returns boolean

    • Calculates the linear interpolation (lerp) between the current value and v, using a as the interpolation factor, then updates the vector's value to the result.

      Parameters

      • v: Vector4
      • a: number

        The interpolation factor, specified as a number between [0, 1].

      Returns this

    • Sets the vector's component values to those specified in x, y, z and w.

      Parameters

      • x: number
      • y: number
      • z: number
      • w: number

      Returns this