Skip to content

shz_vec3_rotate_yxz

Markdown
SHZ_INLINE shz_vec3_t shz_vec3_rotate_yxz(shz_vec3_t vec, float yRadians, float xRadians, float zRadians) SHZ_NOEXCEPT;

Rotates the given 3D vector by a Y-X-Z rotation, with the corresponding angles given in radians.

NameTypeDescription
vecshz_vec3_tThe vector to rotate.
yRadiansfloatAngle about the Y axis, in radians.
xRadiansfloatAngle about the X axis, in radians.
zRadiansfloatAngle about the Z axis, in radians.

vec rotated by the given angles.

The result is equivalent to transforming vec by the matrix built by shz_xmtrx_init_rotation_yxz().

  • The given angles are represented as Tait-Bryan angles, representing an intrinsic rotation.
  • 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.
  • 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:1107
  • Module: Vector, section "Rotations"

shz_xmtrx_init_rotation_yxz, shz_vec3_rotate_x, shz_vec3_rotate_y, shz_vec3_rotate_z