Skip to content

shz_quat_normalize_safe

Markdown
SHZ_INLINE shz_quat_t shz_quat_normalize_safe(shz_quat_t quat) SHZ_NOEXCEPT;

SAFELY returns the normalized form of the given quaternion.

NameTypeDescription
quatshz_quat_tThe quaternion to normalize.

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

Safely returns the identity quaternion when quat has a magnitude of 0.0f and cannot be normalized.

  • _safe: Guards degenerate input (zero-length vectors, zero denominators) at a small cost. (Naming and Suffixes)

shz_quat_normalize, shz_quat_normalize_or, shz_quat_identity