Serializable THREE.js Vector4

Hierarchy-Diagram

UML class diagram of Vector4
Legend
icon for a class in the UML class diagram class

Hierarchy

  • Vector4
    • Vector4

Constructors

  • Parameters

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

    Returns Vector4

Properties

height: number
isVector4: true
w: number
width: number
x: number
y: number
z: number

Methods

  • Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.

    Returns Iterator<number, any, undefined>

  • Adds v to this vector.

    Parameters

    • v: Vector4Like

    Returns this

  • Parameters

    • scalar: number

    Returns this

  • Parameters

    • v: Vector4Like
    • s: number

    Returns this

  • Sets this vector to a + b.

    Parameters

    • a: Vector4Like
    • b: Vector4Like

    Returns this

  • Parameters

    • m: Matrix4

    Returns this

  • Returns this

  • Parameters

    • min: Vector4Like
    • max: Vector4Like

    Returns this

  • Parameters

    • min: number
    • max: number

    Returns this

  • Copies value of v to this vector.

    Parameters

    • v: Vector4Like

    Returns this

  • Divides this vector by scalar s. Set vector to ( 0, 0, 0 ) if s == 0.

    Parameters

    • s: number

    Returns this

  • Computes dot product of this vector and v.

    Parameters

    • v: Vector4Like

    Returns number

  • Checks for strict equality of this vector and v.

    Parameters

    • v: Vector4Like

    Returns boolean

  • Returns this

  • Sets this vector's x, y, z and w value from the provided array or array-like.

    Parameters

    • array: number[] | ArrayLike<number>

      the source array or array-like.

    • Optional offset: number

      (optional) offset into the array. Default is 0.

    Returns this

  • Parameters

    • attribute: BufferAttribute
    • index: number

    Returns this

  • Parameters

    • index: number

    Returns number

  • Computes length of this vector.

    Returns number

  • Computes squared length of this vector.

    Returns number

  • Linearly interpolate between this vector and v with alpha factor.

    Parameters

    • v: Vector4Like
    • alpha: number

    Returns this

  • Parameters

    • v1: Vector4Like
    • v2: Vector4Like
    • alpha: number

    Returns this

  • Computes the Manhattan length of this vector.

    see Taxicab Geometry

    Returns number

  • Parameters

    • v: Vector4Like

    Returns this

  • Parameters

    • v: Vector4Like

    Returns this

  • Parameters

    • v: Vector4Like

    Returns this

  • Multiplies this vector by scalar s.

    Parameters

    • s: number

    Returns this

  • Inverts this vector.

    Returns this

  • Normalizes this vector.

    Returns this

  • Sets this vector's x, y, z and w from Math.random

    Returns this

  • Returns this

  • Returns this

  • Sets value of this vector.

    Parameters

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

    Returns this

  • Parameters

    • index: number
    • value: number

    Returns this

  • Normalizes this vector and multiplies it by l.

    Parameters

    • length: number

    Returns this

  • Sets all values of this vector.

    Parameters

    • scalar: number

    Returns this

  • Sets w component of this vector.

    Parameters

    • w: number

    Returns this

  • Sets X component of this vector.

    Parameters

    • x: number

    Returns this

  • Sets Y component of this vector.

    Parameters

    • y: number

    Returns this

  • Sets Z component of this vector.

    Parameters

    • z: number

    Returns this

  • Subtracts v from this vector.

    Parameters

    • v: Vector4Like

    Returns this

  • Parameters

    • s: number

    Returns this

  • Sets this vector to a - b.

    Parameters

    • a: Vector4Like
    • b: Vector4Like

    Returns this

  • Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.

    Parameters

    • Optional array: number[]

      (optional) array to store the vector to. If this is not provided, a new array will be created.

    • Optional offset: number

      (optional) optional offset into the array.

    Returns number[]

    The created or provided array.

  • Parameters

    • Optional array: Vector4Tuple
    • Optional offset: 0

    Returns Vector4Tuple

  • Copies x, y, z and w into the provided array-like.

    Parameters

    • array: ArrayLike<number>

      array-like to store the vector to.

    • Optional offset: number

      (optional) optional offset into the array-like.

    Returns ArrayLike<number>

    The provided array-like.