Skip to content

shz_vec4_normalize_or

Markdown
SHZ_INLINE shz_vec4_t shz_vec4_normalize_or(shz_vec4_t vec, shz_vec4_t alt) SHZ_NOEXCEPT;

Returns a normalized unit vector from the given 4D vector, or an alternate value.

NameTypeDescription
vecshz_vec4_tThe vector to normalize.
altshz_vec4_tThe vector to return when vec cannot be normalized.

The unit vector pointing in the same direction as vec, or alt.

Safely returns alt when vec has a magnitude of 0.0f and cannot be normalized.

shz_vec4_normalize, shz_vec4_normalize_safe