Scales the vector's components by the given factor. Does not modify the vector.
Factor by which to scale the vector.
A new, scaled vector.
Calculates the length of the vector squared.
The vector's length squared.
Calculates the length of the vector.
The vector's length.
Calculates the length of the vector squared, ignoring the Z axis.
The vector's length when projected onto the Z plane, squared.
Calculates the length of the vector, ignoring the Z axis.
The vector's length when projected onto the Z plane.
Normalizes the vector in-place, turning it into a unit vector.
The vector's length before normalizing.
Computes the dot product between this vector and another vector.
The vector with which to compute the dot product.
The dot product of this vector and the other vector.
Converts the vector to a pretty-printable string.
A string in the form "(x y z)", with each component fixed
to 3 digits of precision after the decimal point.
Converts the vector to a "keyvalue string". Makes more sense in VScript, where setting vector keyvalues from strings is normal.
Technically, the VScript version of this function adds an extra bracket to the output. I'm not replicating that here, as it's very clearly unintentional.
A string in the form "x y z", not truncated.
Similar to the Array map method, applies a function to each element of the vector.
Function to call for each element of the vector. The function is provided the value and index of the current component.
A new vector, gained from applying the callback to each element.
Normalizes this vector in-place and returns it, discarding the length byproduct.
This vector, normalized.
Converts direction vector(s) to a vector of pitch/yaw/roll angles. The vector on which this method is called is treated as the forward-vector.
Optionalup: VectorUp-vector, optional. If provided, used for calculating roll.
A new vector containing Euler angles in radians, in the form (pitch, yaw, roll). Original vector is not modified.
VScript-like 3D vector implementation.