Class Vector4

Describes a 4D-vector.

Hierarchy

  • Vector4

Constructors

  • Constructor of Vector4.

    Parameters

    • x: number = 0

      The x component of the vector, default 0

    • y: number = 0

      The y component of the vector, default 0

    • z: number = 0

      The z component of the vector, default 0

    • w: number = 0

      The w component of the vector, default 0

    Returns Vector4

Properties

_onValueChanged: (() => void) = null

Type declaration

    • (): void
    • Internal

      Returns void

_w: number
_x: number
_y: number
_z: number
_one: Vector4 = ...
_zero: Vector4 = ...

Accessors

Methods

  • Calculate the length of this vector.

    Returns

    The length of this vector

    Returns number

  • Calculate the squared length of this vector.

    Returns

    The squared length of this vector

    Returns number

  • Scale this vector by the given value.

    Returns

    This vector

    Parameters

    • s: number

      The amount by which to scale the vector

    Returns Vector4

  • Set the value of this vector.

    Returns

    This vector

    Parameters

    • x: number

      The x component of the vector

    • y: number

      The y component of the vector

    • z: number

      The z component of the vector

    • w: number

      The w component of the vector

    Returns Vector4

  • Set the value of this vector by an array.

    Returns

    This vector

    Parameters

    • array: ArrayLike<number>

      The array

    • offset: number = 0

      The start offset of the array

    Returns Vector4

  • Clone the value of this vector to an array.

    Parameters

    • out: Float32Array | Float64Array | number[]

      The array

    • outOffset: number = 0

      The start offset of the array

    Returns void

  • Determines the squared distance of two vectors.

    Returns

    The squared distance of two vectors

    Parameters

    Returns number

  • Determines the dot product of two vectors.

    Returns

    The dot product of two vectors

    Parameters

    • left: Vector4

      The first vector to dot

    • right: Vector4

      The second vector to dot

    Returns number

  • Determines whether the specified vectors are equals.

    Returns

    True if the specified vectors are equals, false otherwise

    Parameters

    • left: Vector4

      The first vector to compare

    • right: Vector4

      The second vector to compare

    Returns boolean

  • Performs a linear interpolation between two vectors.

    Parameters

    • start: Vector4

      The first vector

    • end: Vector4

      The second vector

    • t: number

      The blend amount where 0 returns start and 1 end

    • out: Vector4

      The result of linear blending between two vectors

    Returns void

  • Calculate a vector containing the largest components of the specified vectors.

    Parameters

    • left: Vector4

      The first vector

    • right: Vector4

      The second vector

    • out: Vector4

      The vector containing the largest components of the specified vectors

    Returns void

  • Calculate a vector containing the smallest components of the specified vectors.

    Parameters

    • left: Vector4

      The first vector

    • right: Vector4

      The second vector

    • out: Vector4

      The vector containing the smallest components of the specified vectors

    Returns void

  • Scale a vector by the given value.

    Parameters

    • a: Vector4

      The vector to scale

    • s: number

      The amount by which to scale the vector

    • out: Vector4

      The scaled vector

    Returns void

Generated using TypeDoc