shz_quat_normalize_safe
SHZ_INLINE shz_quat_t shz_quat_normalize_safe(shz_quat_t quat) SHZ_NOEXCEPT;SAFELY returns the normalized form of the given quaternion.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
quat | shz_quat_t | The quaternion to normalize. |
Returns
Section titled “Returns”The unit quaternion in the same direction as quat, or the identity.
Details
Section titled “Details”Safely returns the identity quaternion when quat has a magnitude of 0.0f and cannot be normalized.
Naming and requirements
Section titled “Naming and requirements”_safe: Guards degenerate input (zero-length vectors, zero denominators) at a small cost. (Naming and Suffixes)
Availability
Section titled “Availability”- C++ equivalent:
shz::quat::normalized_safe - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_quat.h:343 - Module: Quaternion, section "Modifiers"
See also
Section titled “See also”shz_quat_normalize, shz_quat_normalize_or, shz_quat_identity