shz_vec3_rotate
SHZ_INLINE shz_vec3_t shz_vec3_rotate(shz_vec3_t vec, float angle, shz_vec3_t axis) SHZ_NOEXCEPT;Rotates the given 3D vector by angle radians about the given axis.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
vec | shz_vec3_t | The vector to rotate. |
angle | float | Angle of rotation, in radians. |
axis | shz_vec3_t | Axis of rotation. |
Returns
Section titled “Returns”vec rotated by angle about axis.
Details
Section titled “Details”The axis does not need to be normalized.
Warnings
Section titled “Warnings”- This routine should only be used for one-off rotations of a single vector. To rotate multiple vectors in a batch, use the XMTRX API.
Availability
Section titled “Availability”- C++ equivalent: none (call the C function from C++)
- Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_vector.h:1124 - Module: Vector, section "Rotations"
See also
Section titled “See also”shz_vec3_rotate_dir, shz_xmtrx_init_rotation, shz_vec3_rotate_x, shz_vec3_rotate_xyz