Skip to content

shz_vec3_normalize_or

Markdown
SHZ_INLINE shz_vec3_t shz_vec3_normalize_or(shz_vec3_t vec, shz_vec3_t alt) SHZ_NOEXCEPT;

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

NameTypeDescription
vecshz_vec3_tThe vector to normalize.
altshz_vec3_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_vec3_normalize, shz_vec3_normalize_safe