shz_quat_normalize_or
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.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
quat | shz_quat_t | The quaternion to normalize. |
alt | shz_quat_t | The quaternion to return when quat cannot be normalized. |
Returns
Section titled “Returns”The unit quaternion in the same direction as quat, or alt.
Details
Section titled “Details”Safely returns alt when quat has a magnitude of 0.0f and cannot be normalized.
Availability
Section titled “Availability”- C++ equivalent:
shz::quat::normalized_or - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_quat.h:331 - Module: Quaternion, section "Modifiers"