shz_vec4_normalize
SHZ_INLINE shz_vec4_t shz_vec4_normalize(shz_vec4_t vec) SHZ_NOEXCEPT;Returns a normalized unit vector from the given 4D vector.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
vec | shz_vec4_t | The vector to normalize. |
Returns
Section titled “Returns”The unit vector pointing in the same direction as vec.
Details
Section titled “Details”This is the fastest normalization routine, which does not check for a zero-length vector.
Warnings
Section titled “Warnings”- Results in a division-by-zero when
vechas a magnitude of0.0f.
Availability
Section titled “Availability”- C++ equivalent:
shz::vec4::direction,shz::vec4::normalize,shz::vec4::normalized - Type-generic form:
shz_vec_normalize() - Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_vector.h:668 - Module: Vector, section "Magnitude"