Skip to content

shz_vec4_normalize

Markdown
SHZ_INLINE shz_vec4_t shz_vec4_normalize(shz_vec4_t vec) SHZ_NOEXCEPT;

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

NameTypeDescription
vecshz_vec4_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_vec4_normalize_or, shz_vec4_normalize_safe