Optionalx: number
The x component.
Optionaly: number
The y component.
Optionalz: number
The z component.
Optionalw: number
The w component.
The w component of this Vector.
The x component of this Vector.
The y component of this Vector.
The z component of this Vector.
Calculate the dot product of this Vector and the given Vector.
The Vector4 to dot product with this Vector4.
The dot product of this Vector and the given Vector.
Check whether this Vector is equal to a given Vector.
Performs a strict equality check against each Vector's components.
The vector to check equality with.
A boolean indicating whether the two Vectors are equal or not.
Calculate the length (or magnitude) of this Vector.undefined
The length of this Vector.
Calculate the length of this Vector squared.undefined
The length of this Vector, squared.
Normalize this Vector.
Makes the vector a unit length vector (magnitude of 1) in the same direction.undefined
This Vector4.
Scale this Vector by the given value.
The value to scale this Vector by.
This Vector4.
Set the x, y, z and w components of the this Vector to the given x, y, z and w values.
The x value to set for this Vector, or an object containing x, y, z and w components.
The y value to set for this Vector.
The z value to set for this Vector.
The w value to set for this Vector.
This Vector4.
Transform this Vector with the given Quaternion.
The Quaternion to transform this Vector with.
This Vector4.
A four-component vector (x, y, z, w) for use in 3D mathematics and transformations.
Vector4 is commonly used to represent homogeneous coordinates in 3D space, where the
wcomponent acts as a scaling factor, making it compatible with 4x4 matrix multiplication viaMatrix4. It is also used to represent RGBA color values, quaternion components, and any other quantity that requires four independent scalar values. The class supports the standard vector operations you would expect: addition, subtraction, scaling, normalization, dot product, linear interpolation, and transformation by bothMatrix4andQuaternionobjects.