Skip to content

shz_mat4x4_init_rotation_dir

Markdown
SHZ_INLINE void shz_mat4x4_init_rotation_dir(shz_mat4x4_t* mat, float angle, float x, float y, float z) SHZ_NOEXCEPT;

Initializes the given 4x4 matrix to contain a 3D rotation matrix of angle radians about the given direction.

NameTypeDescription
matshz_mat4x4_t *
anglefloat
xfloat
yfloat
zfloat

Nothing (void).

This is a faster version of shz_mat4x4_init_rotation() or glRotatef() which requires being passed a unit vector for the rotation axis.

  • The vector components representing the axis of rotation must be prenormalized!
  • 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.

shz_mat4x4_init_rotation