Cluster Creator Kit Script Reference
    Preparing search index...

    Class Vector3

    A 3-dimensional vector.

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

    Index

    Constructors

    • Returns Vector3

    • Parameters

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

      Returns Vector3

    Properties

    x: number
    y: number
    z: number

    Methods

    • Adds v to the vector's value.

      Parameters

      Returns this

    • Adds the scalar value s to the vector's x, y, and z components.

      Parameters

      • s: number

      Returns this

    • Applies the rotation q to the vector.

      Parameters

      Returns this

    • Updates the vector's value to the cross product of the vector and v.

      Parameters

      Returns this

    • Divides the vector by v.

      Parameters

      Returns this

    • Divides the vector by the scalar value s.

      Parameters

      • s: number

      Returns this

    • Returns the dot product of the vector and v.

      Parameters

      Returns number

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

      Parameters

      Returns boolean

    • Returns the vector's length.

      Returns number

    • Returns the vector's squared length.

      Returns number

    • 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: Vector3
      • a: number

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

      Returns this

    • Multiplies the vector by v.

      Parameters

      Returns this

    • Multiplies the vector by the scalar value s.

      Parameters

      • s: number

      Returns this

    • Negates the vector's value.

      Returns this

    • Normalizes the vector's value.

      Returns this

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

      Parameters

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

      Returns this

    • Subtracts v from the vector's value.

      Parameters

      Returns this

    • Subtracts the scalar value s from the vector's x, y, and z components.

      Parameters

      • s: number

      Returns this