2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
29 static constexpr size_t
Rows = 4;
30 static constexpr size_t
Cols = 4;
32 mat4x4()
noexcept =
default;
73
74
75
77 SHZ_FORCE_INLINE
void init_identity()
noexcept {
81 SHZ_FORCE_INLINE
void init_identity_safe()
noexcept {
85 SHZ_FORCE_INLINE
void init_zero()
noexcept {
89 SHZ_FORCE_INLINE
void init_one()
noexcept {
93 SHZ_FORCE_INLINE
void init_fill(
float value)
noexcept {
97 SHZ_FORCE_INLINE
void init_translation(
float x,
float y,
float z)
noexcept {
101 SHZ_FORCE_INLINE
void init_scale(
float x,
float y,
float z)
noexcept {
105 SHZ_FORCE_INLINE
void init_rotation_x(
float angle)
noexcept {
109 SHZ_FORCE_INLINE
void init_rotation_y(
float angle)
noexcept {
113 SHZ_FORCE_INLINE
void init_rotation_z(
float angle)
noexcept {
117 SHZ_FORCE_INLINE
void init_rotation_xyz(
float xAngle,
float yAngle,
float zAngle)
noexcept {
121 SHZ_FORCE_INLINE
void init_rotation_zyx(
float zAngle,
float yAngle,
float xAngle)
noexcept {
125 SHZ_FORCE_INLINE
void init_rotation_zxy(
float zAngle,
float xAngle,
float yAngle)
noexcept {
129 SHZ_FORCE_INLINE
void init_rotation_yxz(
float yAngle,
float xAngle,
float zAngle)
noexcept {
134 SHZ_FORCE_INLINE
void init_rotation(
float angle,
float x,
float y,
float z)
noexcept {
138 SHZ_FORCE_INLINE
void init_rotation(
quat q)
noexcept {
142 SHZ_FORCE_INLINE
void init_diagonal(
float x,
float y,
float z,
float w)
noexcept {
146 SHZ_FORCE_INLINE
void init_upper_triangular(
float col1,
vec2 col2,
vec3 col3,
vec4 col4)
noexcept{
147 shz_mat4x4_init_upper_triangular(
this, col1, col2, col3, col4);
150 SHZ_FORCE_INLINE
void init_lower_triangular(
vec4 col1,
vec3 col2,
vec2 col3,
float col4)
noexcept {
151 shz_mat4x4_init_lower_triangular(
this, col1, col2, col3, col4);
154 SHZ_FORCE_INLINE
void init_symmetric_skew(
float x,
float y,
float z)
noexcept {
158 SHZ_FORCE_INLINE
void init_outer_product(
vec4 v1,
vec4 v2)
noexcept {
159 shz_mat4x4_init_outer_product(
this, v1, v2);
162 SHZ_FORCE_INLINE
void init_permutation_wxyz()
noexcept {
166 SHZ_FORCE_INLINE
void init_permutation_yzwx()
noexcept {
170 SHZ_FORCE_INLINE
void init_screen(
float width,
float height)
noexcept {
174 SHZ_FORCE_INLINE
void init_lookat(
vec3 eye,
vec3 center,
vec3 up)
noexcept {
175 shz_mat4x4_init_lookat(
this, eye, center, up);
178 SHZ_FORCE_INLINE
void init_ortho(
float left,
float right,
float bottom,
float top,
float near,
float far)
noexcept {
182 SHZ_FORCE_INLINE
void init_frustum(
float left,
float right,
float bottom,
float top,
float near,
float far)
noexcept {
186 SHZ_FORCE_INLINE
void init_perspective(
float fov,
float aspect,
float near_z)
noexcept {
193
194
195
198 SHZ_FORCE_INLINE
vec4 row(size_t index)
const noexcept {
203 SHZ_FORCE_INLINE
vec4 col(size_t index)
const noexcept {
210
211
212
214 SHZ_FORCE_INLINE
void set_row(size_t index,
vec4 values)
noexcept {
215 shz_mat4x4_set_row(
this, index, values);
218 SHZ_FORCE_INLINE
void set_col(size_t index,
vec4 values)
noexcept {
219 shz_mat4x4_set_col(
this, index, values);
222 SHZ_FORCE_INLINE
void swap_rows(size_t row1, size_t row2)
noexcept {
226 SHZ_FORCE_INLINE
void swap_cols(size_t col1, size_t col2)
noexcept {
230 SHZ_FORCE_INLINE
void set_translation(
float x,
float y,
float z)
noexcept {
234 SHZ_FORCE_INLINE
void set_rotation(
quat rot)
noexcept {
238 SHZ_FORCE_INLINE
void set_diagonal(
float x,
float y,
float z,
float w)
noexcept {
245
246
247
249 SHZ_FORCE_INLINE
void apply(
const shz_mat4x4_t& mat)
noexcept {
253 SHZ_FORCE_INLINE
void apply(
const float mat[16])
noexcept {
257 SHZ_FORCE_INLINE
void apply_transpose(
const shz_mat4x4_t& mat)
noexcept {
261 SHZ_FORCE_INLINE
void apply_transpose(
const float mat[16])
noexcept {
265 SHZ_FORCE_INLINE
void apply_scale(
float x,
float y,
float z)
noexcept {
269 SHZ_FORCE_INLINE
void apply_translation(
float x,
float y,
float z)
noexcept {
273 SHZ_FORCE_INLINE
void apply_rotation_x(
float angle)
noexcept {
277 SHZ_FORCE_INLINE
void apply_rotation_y(
float angle)
noexcept {
281 SHZ_FORCE_INLINE
void apply_rotation_z(
float angle)
noexcept {
285 SHZ_FORCE_INLINE
void apply_rotation_xyz(
float xAngle,
float yAngle,
float zAngle)
noexcept {
289 SHZ_FORCE_INLINE
void apply_rotation_zyx(
float zAngle,
float yAngle,
float xAngle)
noexcept {
293 SHZ_FORCE_INLINE
void apply_rotation_zxy(
float zAngle,
float xAngle,
float yAngle)
noexcept {
297 SHZ_FORCE_INLINE
void apply_rotation_yxz(
float yAngle,
float xAngle,
float zAngle)
noexcept {
301 SHZ_FORCE_INLINE
void apply_rotation(
float angle,
float x,
float y,
float z)
noexcept {
305 SHZ_FORCE_INLINE
void apply_rotation(
quat q)
noexcept {
309 SHZ_FORCE_INLINE
void apply_lookat(
vec3 pos,
vec3 target,
vec3 up)
noexcept {
310 shz_mat4x4_apply_lookat(
this, pos, target, up);
313 SHZ_FORCE_INLINE
void apply_perspective(
float fov,
float aspect,
float near_z)
noexcept {
317 SHZ_FORCE_INLINE
void apply_screen(
float width,
float height)
noexcept {
321 SHZ_FORCE_INLINE
void apply_symmetric_skew(
float x,
float y,
float z)
noexcept {
325 SHZ_FORCE_INLINE
void apply_permutation_wxyz()
noexcept {
329 SHZ_FORCE_INLINE
void apply_permutation_yzwx()
noexcept {
333 SHZ_FORCE_INLINE
void apply_self()
noexcept {
340
341
342
344 SHZ_FORCE_INLINE
void translate(
float x,
float y,
float z)
noexcept {
348 SHZ_FORCE_INLINE
void scale(
float x,
float y,
float z)
noexcept {
352 SHZ_FORCE_INLINE
void rotate_x(
float radians)
noexcept {
356 SHZ_FORCE_INLINE
void rotate_y(
float radians)
noexcept {
360 SHZ_FORCE_INLINE
void rotate_z(
float radians)
noexcept {
364 SHZ_FORCE_INLINE
void rotate_xyz(
float xRadians,
float yRadians,
float zRadians)
noexcept {
368 SHZ_FORCE_INLINE
void rotate_zyx(
float zRadians,
float yRadians,
float xRadians)
noexcept {
372 SHZ_FORCE_INLINE
void rotate_zxy(
float zRadians,
float xRadians,
float yRadians)
noexcept {
376 SHZ_FORCE_INLINE
void rotate_yxz(
float yRadians,
float xRadians,
float zRadians)
noexcept {
380 SHZ_FORCE_INLINE
void rotate(
float radians,
float xAxis,
float yAxis,
float zAxis)
noexcept {
387
388
389
391 SHZ_FORCE_INLINE
static void mult(
mat4x4* dst,
const mat4x4& lhs,
const mat4x4& rhs)
noexcept {
395 SHZ_FORCE_INLINE
static void mult(
mat4x4* dst,
const mat4x4& lhs,
const float rhs[16])
noexcept {
399 SHZ_FORCE_INLINE
vec2 transform(
vec2 in)
const noexcept {
400 return shz_mat4x4_transform_vec2(
this, in);
403 SHZ_FORCE_INLINE
vec3 transform(
vec3 in)
const noexcept {
404 return shz_mat4x4_transform_vec3(
this, in);
407 SHZ_FORCE_INLINE
vec4 transform(
vec4 in)
const noexcept {
408 return shz_mat4x4_transform_vec4(
this, in);
411 SHZ_FORCE_INLINE
vec2 transform_point(
vec2 pt)
const noexcept {
412 return shz_mat4x4_transform_point2(
this, pt);
415 SHZ_FORCE_INLINE
vec3 transform_point(
vec3 pt)
const noexcept {
416 return shz_mat4x4_transform_point3(
this, pt);
419 SHZ_FORCE_INLINE
vec2 transform_transpose(
vec2 in)
const noexcept {
420 return shz_mat4x4_transform_vec2_transpose(
this, in);
423 SHZ_FORCE_INLINE
vec3 transform_transpose(
vec3 in)
const noexcept {
424 return shz_mat4x4_transform_vec3_transpose(
this, in);
427 SHZ_FORCE_INLINE
vec4 transform_transpose(
vec4 in)
const noexcept {
428 return shz_mat4x4_transform_vec4_transpose(
this, in);
431 SHZ_FORCE_INLINE
vec2 transform_point_transpose(
vec2 pt)
const noexcept {
432 return shz_mat4x4_transform_point2_transpose(
this, pt);
435 SHZ_FORCE_INLINE
vec3 transform_point_transpose(
vec3 pt)
const noexcept {
436 return shz_mat4x4_transform_point3_transpose(
this, pt);
442
443
444
446 SHZ_FORCE_INLINE
static void copy(shz_mat4x4_t* lhs,
const shz_mat4x4_t& rhs)
noexcept {
450 SHZ_FORCE_INLINE
static void copy(shz_mat4x4_t* lhs,
const float rhs[16])
noexcept {
454 SHZ_FORCE_INLINE
quat to_quat()
const noexcept {
458 SHZ_FORCE_INLINE
float determinant()
const noexcept {
462 SHZ_FORCE_INLINE
float trace()
const noexcept {
466 SHZ_FORCE_INLINE
void inverse(
mat4x4* out)
const noexcept {
470 SHZ_FORCE_INLINE
void inverse_block_triangular(
mat4x4* out)
const noexcept {
474 SHZ_FORCE_INLINE
void decompose(
vec3* translation,
quat* rotation,
vec3* scale)
const noexcept {
475 shz_mat4x4_decompose(
this, translation, rotation, scale);
Namespace enclosing the SH4ZAM C++ API.
void shz_mat4x4_apply_rotation_y(shz_mat4x4_t *mat, float yAngle) SHZ_NOEXCEPT
Multiplies and accumulates a rotation matrix by yAngle radians about the Y-axis onto the given matrix...
void shz_mat4x4_scale(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates mat by a 3D scaling matrix with the given components.
void shz_mat4x4_init_rotation_z(shz_mat4x4_t *mat, float zAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix by zAngle radians over the Z-axis.
void shz_mat4x4_set_diagonal(shz_mat4x4_t *mat, float x, float y, float z, float w) SHZ_NOEXCEPT
Assigns only the 4 elements along the diagonal of the given matrix to the given values.
void shz_mat4x4_init_rotation_zxy(shz_mat4x4_t *mat, float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix from the intrinsic rotation created by the given...
void shz_mat4x4_apply_permutation_yzwx(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_mat4x4_copy_unaligned(shz_mat4x4_t *dst, const float src[16]) SHZ_NOEXCEPT
Copies the given unaligned src 4x4 matrix into the given dst 4x4 matrix.
void shz_mat4x4_rotate_y(shz_mat4x4_t *mat, float radians) SHZ_NOEXCEPT
Multiplies and accumulates mat by a 3D rotation matrix about the Y axis.
void shz_mat4x4_mult(shz_mat4x4_t *mat, const shz_mat4x4_t *lhs, const shz_mat4x4_t *rhs) SHZ_NOEXCEPT
Multiplies two 4x4 matrices together, storing the result into a third.
void shz_mat4x4_apply_transpose(shz_mat4x4_t *dst, const shz_mat4x4_t *src) SHZ_NOEXCEPT
Multiplies and accumulates the transposed src 4x4 matrix onto the dst 4x4 matrix.
void shz_mat4x4_apply_transpose_unaligned(shz_mat4x4_t *dst, const float src[16]) SHZ_NOEXCEPT
Multiplies and accumulates the transposed unaligned src 4x4 matrix onto the dst 4x4 matrix.
void shz_mat4x4_init_identity(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix to the identity matrix as fast as possible.
void shz_mat4x4_init_rotation(shz_mat4x4_t *mat, float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix about the given axis rotated by angle radians.
void shz_mat4x4_init_permutation_wxyz(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the matrix to to a permutation matrix, which reorders the components of transformed vecto...
void shz_mat4x4_init_rotation_xyz(shz_mat4x4_t *mat, float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix from the intrinsic rotation created by the given...
void shz_mat4x4_apply_rotation_quat(shz_mat4x4_t *m, shz_quat_t q) SHZ_NOEXCEPT
Multiplies and accumulates the given matrix with a rotation matrix whose orientation is given by a qu...
void shz_mat4x4_init_rotation_y(shz_mat4x4_t *mat, float yAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix by yAngle radians over the Y-axis.
void shz_mat4x4_init_zero(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix with all 0s for its element values.
void shz_mat4x4_swap_rows(shz_mat4x4_t *mat, size_t row1, size_t row2) SHZ_NOEXCEPT
Swaps the 4D row vectors located at row1 and row2 within mat.
float shz_mat4x4_determinant(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Returns the determinant of the given 4x4 matrix.
void shz_mat4x4_apply_screen(shz_mat4x4_t *m, float width, float height) SHZ_NOEXCEPT
Multiplies and accumulates the viewport matrix created with the given components ont othe given matri...
void shz_mat4x4_init_rotation_x(shz_mat4x4_t *mat, float xAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix by xAngle radians over the X-axis.
float shz_mat4x4_trace(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Returns the trace of the given 4x4 matrix.
void shz_mat4x4_apply_rotation_zxy(shz_mat4x4_t *mat, float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
Rotates the given transform matrix about the Z axis, then the X axis, then the Y axis by the given an...
void shz_mat4x4_apply_symmetric_skew(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates the given matrix with a symmetric skew matrix formed from the given 3D vec...
void shz_mat4x4_apply_self(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Multiplies and accumulates the given matrix onto itself.
void shz_mat4x4_init_scale(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Initializes the given matrix to a 3D scaling matrix with the given dimensions.
void shz_mat4x4_init_identity_safe(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix to the identity matrix, safely zeroing out NaN values.
void shz_mat4x4_apply_rotation_xyz(shz_mat4x4_t *mat, float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
Rotates the given transform matrix about the X axis, then the Y axis, then the Z axis by the given an...
void shz_mat4x4_translate(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates mat by a 3D translation matrix with the given components.
shz_vec4_t shz_mat4x4_col(const shz_mat4x4_t *mat, size_t col) SHZ_NOEXCEPT
Extracts the col index as a 4D column vector from the given matrix.
void shz_mat4x4_apply_permutation_wxyz(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_mat4x4_rotate(shz_mat4x4_t *mat, float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Multiplies and accumulates mat by the 3D rotation matrix formed by the given axis and angle.
void shz_mat4x4_init_perspective(shz_mat4x4_t *mat, float fov, float aspect, float near_z) SHZ_NOEXCEPT
Initializes the given matrix to a perspective projection matrix.
void shz_mat4x4_apply_rotation_yxz(shz_mat4x4_t *mat, float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
Rotates the given transform matrix about the Y axis, then the X axis, then the Z axis by the given an...
void shz_mat4x4_set_translation(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Assigns only the 3D translation-related elements of the given matrix to the given values.
void shz_mat4x4_rotate_xyz(shz_mat4x4_t *mat, float xRadians, float yRadians, float zRadians) SHZ_NOEXCEPT
Multiplies and accumulates mat by 3D rotation matrices about the X then Y then Z axes.
void shz_mat4x4_apply_perspective(shz_mat4x4_t *m, float fov, float aspect, float near_z) SHZ_NOEXCEPT
Multiplies and accumulates the perspective matrix constructed from the given values onto the given ma...
void shz_mat4x4_rotate_yxz(shz_mat4x4_t *mat, float yRadians, float xRadians, float zRadians) SHZ_NOEXCEPT
Multiplies and accumulates mat by 3D rotation matrices about the Y then X then Z axes.
shz_quat_t shz_mat4x4_to_quat(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Converts the given 4x4 orientation matrix into a quaternion.
void shz_mat4x4_apply(shz_mat4x4_t *dst, const shz_mat4x4_t *src) SHZ_NOEXCEPT
Multiplies and accumulates the src 4x4 matrix onto the dst 4x4 matrix.
void shz_mat4x4_rotate_zxy(shz_mat4x4_t *mat, float zRadians, float xRadians, float yRadians) SHZ_NOEXCEPT
Multiplies and accumulates mat by 3D rotation matrices about the Z then X then Y axes.
void shz_mat4x4_swap_cols(shz_mat4x4_t *mat, size_t col1, size_t col2) SHZ_NOEXCEPT
Swaps the 4D column vectors located at col1 and col2 within mat.
void shz_mat4x4_init_translation(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Initializes the given matrix to a 3D translation matrix with the given coordinates.
void shz_mat4x4_apply_rotation_zyx(shz_mat4x4_t *mat, float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
Rotates the given transform matrix about the Z axis, then the Y axis, then the X axis by the given an...
void shz_mat4x4_copy(shz_mat4x4_t *dst, const shz_mat4x4_t *src) SHZ_NOEXCEPT
Copies the given src 4x4 matrix into the given dst 4x4 matrix.
void shz_mat4x4_rotate_z(shz_mat4x4_t *mat, float radians) SHZ_NOEXCEPT
Multiplies and accumulates mat by a 3D rotation matrix about the Z axis.
void shz_mat4x4_apply_rotation_z(shz_mat4x4_t *mat, float zAngle) SHZ_NOEXCEPT
Multiplies and accumulates a rotation matrix by zAngle radians about the Z-axis onto the given matrix...
void shz_mat4x4_apply_scale(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates the scale-related elements of the given matrix by the given 3D components.
void shz_mat4x4_set_rotation_quat(shz_mat4x4_t *m, shz_quat_t q) SHZ_NOEXCEPT
Sets just the rotational component of the matrix to the orientation given by a quaternion,...
void shz_mat4x4_apply_translation(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Adds the given 3D vector components to the translational values of the given matrix.
void shz_mat4x4_rotate_zyx(shz_mat4x4_t *mat, float zRadians, float yRadians, float xRadians) SHZ_NOEXCEPT
Multiplies and accumulates mat by 3D rotation matrices about the Z then Y then X axes.
void shz_mat4x4_mult_unaligned(shz_mat4x4_t *mat, const shz_mat4x4_t *lhs, const float rhs[16]) SHZ_NOEXCEPT
Multiplies two 4x4 matrices together, with the right handed matrix being unaligned,...
void shz_mat4x4_rotate_x(shz_mat4x4_t *mat, float radians) SHZ_NOEXCEPT
Multiplies and accumulates mat by a 3D rotation matrix about the X axis.
void shz_mat4x4_init_symmetric_skew(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Initializes the given matrix to be the symmetric skew of the given 3D vector components.
void shz_mat4x4_init_rotation_yxz(shz_mat4x4_t *mat, float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix from the intrinsic rotation created by the given...
void shz_mat4x4_init_diagonal(shz_mat4x4_t *mat, float x, float y, float z, float w) SHZ_NOEXCEPT
Initializes the given matrix to a diagonal matrix with the given 4 values.
void shz_mat4x4_init_rotation_zyx(shz_mat4x4_t *mat, float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix from the intrinsic rotation created by the given...
void shz_mat4x4_init_permutation_yzwx(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the matrix to to a permutation matrix, which reorders the components of transformed vecto...
void shz_mat4x4_init_frustum(shz_mat4x4_t *mat, float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Initializes the given matrix to a frustum projection matrix.
void shz_mat4x4_init_ortho(shz_mat4x4_t *mat, float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Initializes the given matrix to an orthographic projection matrix.
void shz_mat4x4_apply_rotation_x(shz_mat4x4_t *mat, float xAngle) SHZ_NOEXCEPT
Multiplies and accumulates a rotation matrix by xAngle radians about the X-axis onto the given matrix...
void shz_mat4x4_init_fill(shz_mat4x4_t *mat, float value) SHZ_NOEXCEPT
Initializes the given matrix with all elements assigned to the given value.
void shz_mat4x4_apply_unaligned(shz_mat4x4_t *dst, const float src[16]) SHZ_NOEXCEPT
Multiplies and accumulates the unaligned src 4x4 matrix onto the dst 4x4 matrix.
shz_vec4_t shz_mat4x4_row(const shz_mat4x4_t *mat, size_t row) SHZ_NOEXCEPT
Extracts the row index as a 4D row vector from the given matrix.
bool shz_mat4x4_equal(const shz_mat4x4_t *SHZ_RESTRICT mat1, const shz_mat4x4_t *mat2) SHZ_NOEXCEPT
Returns true if the two matrices are equal, based on either absolute or relative tolerance.
void shz_mat4x4_apply_rotation(shz_mat4x4_t *mat, float angle, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Rotates the given transform matrix about the arbitrary axis given by a 3D direction vector and angle ...
void shz_mat4x4_inverse(const shz_mat4x4_t *SHZ_RESTRICT mtrx, shz_mat4x4_t *SHZ_RESTRICT out) SHZ_NOEXCEPT
Computes the inverse of a 4x4 matrix.
void shz_mat4x4_init_one(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix with all 1s for its element values.
void shz_mat4x4_init_rotation_quat(shz_mat4x4_t *m, shz_quat_t q) SHZ_NOEXCEPT
Initializes the given matrix to a 3D rotation matrix with its orientation given by a quaternion.
void shz_mat4x4_inverse_block_triangular(const shz_mat4x4_t *mtx, shz_mat4x4_t *out) SHZ_NOEXCEPT
Computes the inverse of a 4x4 matrix in block-triangular form.
void shz_mat4x4_init_screen(shz_mat4x4_t *mat, float width, float height) SHZ_NOEXCEPT
Initializes the given matrix to the viewport matrix with the given dimenions.
vec4 row(size_t index) const noexcept
C++ wrapper for shz_mat4x4_row().
void init_rotation(float angle, float x, float y, float z) noexcept
C++ wrapper for shz_mat4x4_init_rotation().
vec4 col(size_t index) const noexcept
C++ wrapper for shz_mat4x4_col().
static constexpr size_t Rows
Number of rows.
friend auto operator==(const mat4x4 &lhs, const mat4x4 &rhs) noexcept
Overloaded equality operator, for comparing vectors.
static constexpr size_t Cols
Number of columns.
C++ structure representing a quaternion.