Skip to content

shz_mat4x4_rotate_dir

Markdown
SHZ_INLINE void shz_mat4x4_rotate_dir(shz_mat4x4_t* mat, float radians, float x, float y, float z) SHZ_NOEXCEPT;

Multiplies mat by a 3D rotation matrix about a prenormalized axis.

NameTypeDescription
matshz_mat4x4_t *The matrix to rotate in-place.
radiansfloatAngle of rotation, in radians.
xfloatX component of the unit axis of rotation.
yfloatY component of the unit axis of rotation.
zfloatZ component of the unit axis of rotation.

Nothing (void).

This is a faster version of shz_mat4x4_rotate() which skips normalizing the axis of rotation. Constructs a 4x4 rotation matrix of radians about the given axis, RIGHT multiplying it into mat, leaving its translation column unmodified.

  • The vector components representing the axis of rotation must be prenormalized!
  • 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:818
  • Module: Matrix, section "GL Transformations"

shz_mat4x4_rotate, shz_mat4x4_init_rotation_dir, shz_xmtrx_rotate_dir