Optionalx: numberOptionaly: numberOptionalz: numberOptionalw: numberReadonlyisIterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.
Clones this vector.
Divides this vector by scalar s. Set vector to ( 0, 0, 0 ) if s == 0.
Sets this vector's x, y, z and w value from the provided array or array-like.
the source array or array-like.
Optionaloffset: number(optional) offset into the array. Default is 0.
Computes length of this vector.
Computes squared length of this vector.
Linearly interpolate between this vector and v with alpha factor.
Computes the Manhattan length of this vector.
see Taxicab Geometry
Multiplies this vector by scalar s.
Inverts this vector.
Normalizes this vector.
Sets this vector's x, y, z and w from Math.random
Sets value of this vector.
is assumed to be normalized
assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
Sets this vector to the position elements of the [transformation matrix]https://en.wikipedia.org/wiki/Transformation_matrix m.
Normalizes this vector and multiplies it by l.
Sets all values of this vector.
Sets w component of this vector.
Sets X component of this vector.
Sets Y component of this vector.
Sets Z component of this vector.
Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
Optionalarray: number[](optional) array to store the vector to. If this is not provided, a new array will be created.
Optionaloffset: number(optional) optional offset into the array.
The created or provided array.
Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
Optionalarray: Vector4Tuple(optional) array to store the vector to. If this is not provided, a new array will be created.
Optionaloffset: 0(optional) optional offset into the array.
The created or provided array.
4D vector.