Skip to content

shz_mat4x4_rotate

Markdown
SHZ_INLINE void shz_mat4x4_rotate(shz_mat4x4_t* mat, float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT;

Multiplies mat by a 3D rotation matrix about an arbitrary axis.

NameTypeDescription
matshz_mat4x4_t *The matrix to rotate in-place.
radiansfloatAngle of rotation, in radians.
xAxisfloatX component of the axis of rotation.
yAxisfloatY component of the axis of rotation.
zAxisfloatZ component of the axis of rotation.

Nothing (void).

Constructs a 4x4 rotation matrix of radians about the axis with the given components, RIGHT multiplying it into mat. This rotates within the local frame of mat, about its own origin, leaving its translation column unmodified.

The axis does not need to be normalized.

  • This is the equivalent of glRotatef().
  • This routine clobbers XMTRX.
  • shz_mat4x4_t and shz_mat2x2_t arguments must be 8-byte aligned. Unaligned data goes through the float[16] parameters of the _unaligned routines.
  • 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_matrix.h:798
  • Module: Matrix, section "GL Transformations"

shz_xmtrx_rotate, shz_mat4x4_rotate_dir