Skip to content

shz_vec3_normalize

Markdown
SHZ_INLINE shz_vec3_t shz_vec3_normalize(shz_vec3_t vec) SHZ_NOEXCEPT;

Returns a normalized unit vector from the given 3D vector.

NameTypeDescription
vecshz_vec3_tThe vector to normalize.

The unit vector pointing in the same direction as vec.

This is the fastest normalization routine, which does not check for a zero-length vector.

  • Results in a division-by-zero when vec has a magnitude of 0.0f.

shz_vec3_normalize_or, shz_vec3_normalize_safe