Skip to content

shz_quat_normalize_or

Markdown
SHZ_INLINE shz_quat_t shz_quat_normalize_or(shz_quat_t quat, shz_quat_t alt) SHZ_NOEXCEPT;

Returns the normalized form of the given quaternion, or an alternate value.

NameTypeDescription
quatshz_quat_tThe quaternion to normalize.
altshz_quat_tThe quaternion to return when quat cannot be normalized.

The unit quaternion in the same direction as quat, or alt.

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

shz_quat_normalize, shz_quat_normalize_safe