Normalizes the magnitude of the current vector to 1 while maintaining the direction.
This method converts the current vector to a unit vector in the same direction. Only the magnitude of the vector changes.
If the current vector is too small to be normalized, then this function returns the zero vector. A vector is too small to be normalized if it is considered equal to the zero vector.
Note that this function changes the current vector. If you want to keep the current vector unchanged, use normalized variable or the static version of this function.
Additional resources: normalized.
Parameter | Description |
---|---|
value | The vector to be normalized. |
Vector3 A new vector with the same direction as the original vector but with a magnitude of 1.0.
Obtains the normalized version of an input vector.
Returns a normalized vector based on the given vector. The normalized vector has a magnitude of 1 and is in the same direction as the given vector.
If the given vector is too small to be normalized, then this function returns the zero vector. A vector is too small to be normalized if it is considered equal to the zero vector.
Note that this function doesn't modify the given vector. To modify and normalize the current vector, use the instance version of this method, with no parameter.
Additional resources: normalized.