SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
Loading...
Searching...
No Matches
shz::mat4x4 Struct Reference
Inheritance diagram for shz::mat4x4:
Collaboration diagram for shz::mat4x4:

Public Member Functions

Initialization

Routines for fully initializing a matrix.

void init_identity () noexcept
 
void init_identity_safe () noexcept
 
void init_zero () noexcept
 
void init_one () noexcept
 
void init_fill (float value) noexcept
 
void init_translation (float x, float y, float z) noexcept
 
void init_scale (float x, float y, float z) noexcept
 
void init_rotation_x (float angle) noexcept
 
void init_rotation_y (float angle) noexcept
 
void init_rotation_z (float angle) noexcept
 
void init_rotation_xyz (float xAngle, float yAngle, float zAngle) noexcept
 
void init_rotation_zyx (float zAngle, float yAngle, float xAngle) noexcept
 
void init_rotation_zxy (float zAngle, float xAngle, float yAngle) noexcept
 
void init_rotation_yxz (float yAngle, float xAngle, float zAngle) noexcept
 
void init_rotation (float angle, float x, float y, float z) noexcept
 
void init_rotation (quat q) noexcept
 
void init_diagonal (float x, float y, float z, float w) noexcept
 
void init_upper_triangular (float col1, vec2 col2, vec3 col3, vec4 col4) noexcept
 
void init_lower_triangular (vec4 col1, vec3 col2, vec2 col3, float col4) noexcept
 
void init_symmetric_skew (float x, float y, float z) noexcept
 
void init_outer_product (vec4 v1, vec4 v2) noexcept
 
void init_permutation_wxyz () noexcept
 
void init_permutation_yzwx () noexcept
 
void init_screen (float width, float height) noexcept
 
void init_lookat (vec3 eye, vec3 center, vec3 up) noexcept
 
void init_ortho (float left, float right, float bottom, float top, float near, float far) noexcept
 
void init_frustum (float left, float right, float bottom, float top, float near, float far) noexcept
 
void init_perspective (float fov, float aspect, float near_z) noexcept
 
Getting

Routines for getting specific values within a matrix

vec4 row (size_t index) const noexcept
 
vec4 col (size_t index) const noexcept
 
Setting

Routines for setting specific values within a matrix

void set_row (size_t index, vec4 values) noexcept
 
void set_col (size_t index, vec4 values) noexcept
 
void swap_rows (size_t row1, size_t row2) noexcept
 
void swap_cols (size_t col1, size_t col2) noexcept
 
void set_translation (float x, float y, float z) noexcept
 
void set_rotation (quat rot) noexcept
 
void set_diagonal (float x, float y, float z, float w) noexcept
 
Applying

Routines for multiplying and accumulating onto the given matrix.

void apply (const shz_mat4x4_t &mat) noexcept
 
void apply (const float mat[16]) noexcept
 
void apply_transpose (const shz_mat4x4_t &mat) noexcept
 
void apply_transpose (const float mat[16]) noexcept
 
void apply_scale (float x, float y, float z) noexcept
 
void apply_translation (float x, float y, float z) noexcept
 
void apply_rotation_x (float angle) noexcept
 
void apply_rotation_y (float angle) noexcept
 
void apply_rotation_z (float angle) noexcept
 
void apply_rotation_xyz (float xAngle, float yAngle, float zAngle) noexcept
 
void apply_rotation_zyx (float zAngle, float yAngle, float xAngle) noexcept
 
void apply_rotation_zxy (float zAngle, float xAngle, float yAngle) noexcept
 
void apply_rotation_yxz (float yAngle, float xAngle, float zAngle) noexcept
 
void apply_rotation (float angle, float x, float y, float z) noexcept
 
void apply_rotation (quat q) noexcept
 
void apply_lookat (vec3 pos, vec3 target, vec3 up) noexcept
 
void apply_perspective (float fov, float aspect, float near_z) noexcept
 
void apply_screen (float width, float height) noexcept
 
void apply_symmetric_skew (float x, float y, float z) noexcept
 
void apply_permutation_wxyz () noexcept
 
void apply_permutation_yzwx () noexcept
 
void apply_self () noexcept
 
GL Transformations

OpenGL-style 4x4 matrix transforms.

void translate (float x, float y, float z) noexcept
 
void scale (float x, float y, float z) noexcept
 
void rotate_x (float radians) noexcept
 
void rotate_y (float radians) noexcept
 
void rotate_z (float radians) noexcept
 
void rotate_xyz (float xRadians, float yRadians, float zRadians) noexcept
 
void rotate_zyx (float zRadians, float yRadians, float xRadians) noexcept
 
void rotate_zxy (float zRadians, float xRadians, float yRadians) noexcept
 
void rotate_yxz (float yRadians, float xRadians, float zRadians) noexcept
 
void rotate (float radians, float xAxis, float yAxis, float zAxis) noexcept
 

Static Public Attributes

static constexpr size_t Rows
 
static constexpr size_t Cols
 

Friends

auto operator== (const mat4x4 &lhs, const mat4x4 &rhs) noexcept
 

Transforming

Routines for transforming vectors and points by a matrix.

vec2 transform (vec2 in) const noexcept
 
vec3 transform (vec3 in) const noexcept
 
vec4 transform (vec4 in) const noexcept
 
vec2 transform_point (vec2 pt) const noexcept
 
vec3 transform_point (vec3 pt) const noexcept
 
vec2 transform_transpose (vec2 in) const noexcept
 
vec3 transform_transpose (vec3 in) const noexcept
 
vec4 transform_transpose (vec4 in) const noexcept
 
vec2 transform_point_transpose (vec2 pt) const noexcept
 
vec3 transform_point_transpose (vec3 pt) const noexcept
 
static void mult (mat4x4 *dst, const mat4x4 &lhs, const mat4x4 &rhs) noexcept
 
static void mult (mat4x4 *dst, const mat4x4 &lhs, const float rhs[16]) noexcept
 

Miscellaneous

Other matrix-related operations and routines

quat to_quat () const noexcept
 
float determinant () const noexcept
 
float trace () const noexcept
 
void inverse (mat4x4 *out) const noexcept
 
void inverse_block_triangular (mat4x4 *out) const noexcept
 
void decompose (vec3 *translation, quat *rotation, vec3 *scale) const noexcept
 
static void copy (shz_mat4x4_t *lhs, const shz_mat4x4_t &rhs) noexcept
 
static void copy (shz_mat4x4_t *lhs, const float rhs[16]) noexcept
 

Additional Inherited Members

- Data Fields inherited from shz_mat4x4_t
union { 
 
   float   elem [16] 
 
   float   elem2D [4][4] 
 
   shz_vec4_t   col [4] 
 
   struct { 
 
      shz_vec4_t   left 
 
      shz_vec4_t   up 
 
      shz_vec4_t   forward 
 
      shz_vec4_t   pos 
 
   }  
 
};  
 

Detailed Description

Definition at line 28 of file shz_matrix.hpp.

Member Function Documentation

◆ init_identity()

void shz::mat4x4::init_identity ( )
inlinenoexcept

Definition at line 77 of file shz_matrix.hpp.

77 {
79 }
void shz_mat4x4_init_identity(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix to the identity matrix as fast as possible.

◆ init_identity_safe()

void shz::mat4x4::init_identity_safe ( )
inlinenoexcept

Definition at line 81 of file shz_matrix.hpp.

81 {
83 }
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.

◆ init_zero()

void shz::mat4x4::init_zero ( )
inlinenoexcept

Definition at line 85 of file shz_matrix.hpp.

85 {
87 }
void shz_mat4x4_init_zero(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix with all 0s for its element values.

◆ init_one()

void shz::mat4x4::init_one ( )
inlinenoexcept

Definition at line 89 of file shz_matrix.hpp.

89 {
91 }
void shz_mat4x4_init_one(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix with all 1s for its element values.

◆ init_fill()

void shz::mat4x4::init_fill ( float value)
inlinenoexcept

Definition at line 93 of file shz_matrix.hpp.

93 {
94 shz_mat4x4_init_fill(this, value);
95 }
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.

◆ init_translation()

void shz::mat4x4::init_translation ( float x,
float y,
float z )
inlinenoexcept

Definition at line 97 of file shz_matrix.hpp.

97 {
98 shz_mat4x4_init_translation(this, x, y, z);
99 }
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.

◆ init_scale()

void shz::mat4x4::init_scale ( float x,
float y,
float z )
inlinenoexcept

Definition at line 101 of file shz_matrix.hpp.

101 {
102 shz_mat4x4_init_scale(this, x, y, z);
103 }
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.

◆ init_rotation_x()

void shz::mat4x4::init_rotation_x ( float angle)
inlinenoexcept

Definition at line 105 of file shz_matrix.hpp.

105 {
106 shz_mat4x4_init_rotation_x(this, angle);
107 }
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.

◆ init_rotation_y()

void shz::mat4x4::init_rotation_y ( float angle)
inlinenoexcept

Definition at line 109 of file shz_matrix.hpp.

109 {
110 shz_mat4x4_init_rotation_y(this, angle);
111 }
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.

◆ init_rotation_z()

void shz::mat4x4::init_rotation_z ( float angle)
inlinenoexcept

Definition at line 113 of file shz_matrix.hpp.

113 {
114 shz_mat4x4_init_rotation_z(this, angle);
115 }
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.

◆ init_rotation_xyz()

void shz::mat4x4::init_rotation_xyz ( float xAngle,
float yAngle,
float zAngle )
inlinenoexcept

Definition at line 117 of file shz_matrix.hpp.

117 {
118 shz_mat4x4_init_rotation_xyz(this, xAngle, yAngle, zAngle);
119 }
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...

◆ init_rotation_zyx()

void shz::mat4x4::init_rotation_zyx ( float zAngle,
float yAngle,
float xAngle )
inlinenoexcept

Definition at line 121 of file shz_matrix.hpp.

121 {
122 shz_mat4x4_init_rotation_zyx(this, zAngle, yAngle, xAngle);
123 }
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...

◆ init_rotation_zxy()

void shz::mat4x4::init_rotation_zxy ( float zAngle,
float xAngle,
float yAngle )
inlinenoexcept

Definition at line 125 of file shz_matrix.hpp.

125 {
126 shz_mat4x4_init_rotation_zxy(this, zAngle, xAngle, yAngle);
127 }
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...

◆ init_rotation_yxz()

void shz::mat4x4::init_rotation_yxz ( float yAngle,
float xAngle,
float zAngle )
inlinenoexcept

Definition at line 129 of file shz_matrix.hpp.

129 {
130 shz_mat4x4_init_rotation_yxz(this, yAngle, xAngle, zAngle);
131 }
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...

◆ init_rotation() [1/2]

void shz::mat4x4::init_rotation ( float angle,
float x,
float y,
float z )
inlinenoexcept

C++ wrapper for shz_mat4x4_init_rotation().

Definition at line 134 of file shz_matrix.hpp.

134 {
135 shz_mat4x4_init_rotation(this, angle, x, y, z);
136 }
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.

◆ init_rotation() [2/2]

void shz::mat4x4::init_rotation ( quat q)
inlinenoexcept

Definition at line 138 of file shz_matrix.hpp.

138 {
140 }
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.

◆ init_diagonal()

void shz::mat4x4::init_diagonal ( float x,
float y,
float z,
float w )
inlinenoexcept

Definition at line 142 of file shz_matrix.hpp.

142 {
143 shz_mat4x4_init_diagonal(this, x, y, z, w);
144 }
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.

◆ init_upper_triangular()

void shz::mat4x4::init_upper_triangular ( float col1,
vec2 col2,
vec3 col3,
vec4 col4 )
inlinenoexcept

Definition at line 146 of file shz_matrix.hpp.

146 {
147 shz_mat4x4_init_upper_triangular(this, col1, col2, col3, col4);
148 }
void shz_mat4x4_init_upper_triangular(shz_mat4x4_t *mat, float col1, shz_vec2_t col2, shz_vec3_t col3, shz_vec4_t col4) SHZ_NOEXCEPT
Initializes the given matrix to an upper triangular matrix whose nonzero entries have the given value...

◆ init_lower_triangular()

void shz::mat4x4::init_lower_triangular ( vec4 col1,
vec3 col2,
vec2 col3,
float col4 )
inlinenoexcept

Definition at line 150 of file shz_matrix.hpp.

150 {
151 shz_mat4x4_init_lower_triangular(this, col1, col2, col3, col4);
152 }
void shz_mat4x4_init_lower_triangular(shz_mat4x4_t *mat, shz_vec4_t col1, shz_vec3_t col2, shz_vec2_t col3, float col4) SHZ_NOEXCEPT
Initializes the given matrix to a lower triangular matrix whose nonzero entries have the given value.

◆ init_symmetric_skew()

void shz::mat4x4::init_symmetric_skew ( float x,
float y,
float z )
inlinenoexcept

Definition at line 154 of file shz_matrix.hpp.

154 {
155 shz_mat4x4_init_symmetric_skew(this, x, y, z);
156 }
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.

◆ init_outer_product()

void shz::mat4x4::init_outer_product ( vec4 v1,
vec4 v2 )
inlinenoexcept

Definition at line 158 of file shz_matrix.hpp.

158 {
159 shz_mat4x4_init_outer_product(this, v1, v2);
160 }
void shz_mat4x4_init_outer_product(shz_mat4x4_t *mat, shz_vec4_t v1, shz_vec4_t v2) SHZ_NOEXCEPT
Initializes the given matrix to be the result from taking the outer product of the two given 4D vecto...

◆ init_permutation_wxyz()

void shz::mat4x4::init_permutation_wxyz ( )
inlinenoexcept

Definition at line 162 of file shz_matrix.hpp.

162 {
164 }
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...

◆ init_permutation_yzwx()

void shz::mat4x4::init_permutation_yzwx ( )
inlinenoexcept

Definition at line 166 of file shz_matrix.hpp.

166 {
168 }
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...

◆ init_screen()

void shz::mat4x4::init_screen ( float width,
float height )
inlinenoexcept

Definition at line 170 of file shz_matrix.hpp.

170 {
171 shz_mat4x4_init_screen(this, width, height);
172 }
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.

◆ init_lookat()

void shz::mat4x4::init_lookat ( vec3 eye,
vec3 center,
vec3 up )
inlinenoexcept

Definition at line 174 of file shz_matrix.hpp.

174 {
175 shz_mat4x4_init_lookat(this, eye, center, up);
176 }
void shz_mat4x4_init_lookat(shz_mat4x4_t *mat, shz_vec3_t eye, shz_vec3_t center, shz_vec3_t up) SHZ_NOEXCEPT
Initializes the given matrix to a "lookAt" view matrix.
shz_vec4_t up
Access the second column of the matrix as a 1x4 vector.
Definition shz_matrix.h:80

◆ init_ortho()

void shz::mat4x4::init_ortho ( float left,
float right,
float bottom,
float top,
float near,
float far )
inlinenoexcept

Definition at line 178 of file shz_matrix.hpp.

178 {
179 shz_mat4x4_init_ortho(this, left, right, bottom, top, near, far);
180 }
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.
shz_vec4_t left
< Named column vectors.
Definition shz_matrix.h:79

◆ init_frustum()

void shz::mat4x4::init_frustum ( float left,
float right,
float bottom,
float top,
float near,
float far )
inlinenoexcept

Definition at line 182 of file shz_matrix.hpp.

182 {
183 shz_mat4x4_init_frustum(this, left, right, bottom, top, near, far);
184 }
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.

◆ init_perspective()

void shz::mat4x4::init_perspective ( float fov,
float aspect,
float near_z )
inlinenoexcept

Definition at line 186 of file shz_matrix.hpp.

186 {
187 shz_mat4x4_init_perspective(this, fov, aspect, near_z);
188 }
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.

◆ row()

vec4 shz::mat4x4::row ( size_t index) const
inlinenoexcept

C++ wrapper for shz_mat4x4_row().

Definition at line 198 of file shz_matrix.hpp.

198 {
199 return shz_mat4x4_row(this, index);
200 }
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.

◆ col()

vec4 shz::mat4x4::col ( size_t index) const
inlinenoexcept

C++ wrapper for shz_mat4x4_col().

Definition at line 203 of file shz_matrix.hpp.

203 {
204 return shz_mat4x4_col(this, index);
205 }
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.

◆ set_row()

void shz::mat4x4::set_row ( size_t index,
vec4 values )
inlinenoexcept

Definition at line 214 of file shz_matrix.hpp.

214 {
215 shz_mat4x4_set_row(this, index, values);
216 }
void shz_mat4x4_set_row(shz_mat4x4_t *mat, size_t row, shz_vec4_t vec) SHZ_NOEXCEPT
Sets the values of mat at the given row to those of the 4D vector, vec.

◆ set_col()

void shz::mat4x4::set_col ( size_t index,
vec4 values )
inlinenoexcept

Definition at line 218 of file shz_matrix.hpp.

218 {
219 shz_mat4x4_set_col(this, index, values);
220 }
void shz_mat4x4_set_col(shz_mat4x4_t *mat, size_t col, shz_vec4_t vec) SHZ_NOEXCEPT
Sets the values of mat at the given col to those of the 4D vector, vec.

◆ swap_rows()

void shz::mat4x4::swap_rows ( size_t row1,
size_t row2 )
inlinenoexcept

Definition at line 222 of file shz_matrix.hpp.

222 {
223 shz_mat4x4_swap_rows(this, row1, row2);
224 }
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.

◆ swap_cols()

void shz::mat4x4::swap_cols ( size_t col1,
size_t col2 )
inlinenoexcept

Definition at line 226 of file shz_matrix.hpp.

226 {
227 shz_mat4x4_swap_cols(this, col1, col2);
228 }
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.

◆ set_translation()

void shz::mat4x4::set_translation ( float x,
float y,
float z )
inlinenoexcept

Definition at line 230 of file shz_matrix.hpp.

230 {
231 shz_mat4x4_set_translation(this, x, y, z);
232 }
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.

◆ set_rotation()

void shz::mat4x4::set_rotation ( quat rot)
inlinenoexcept

Definition at line 234 of file shz_matrix.hpp.

234 {
236 }
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,...

◆ set_diagonal()

void shz::mat4x4::set_diagonal ( float x,
float y,
float z,
float w )
inlinenoexcept

Definition at line 238 of file shz_matrix.hpp.

238 {
239 shz_mat4x4_set_diagonal(this, x, y, z, w);
240 }
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.

◆ apply() [1/2]

void shz::mat4x4::apply ( const shz_mat4x4_t & mat)
inlinenoexcept

Definition at line 249 of file shz_matrix.hpp.

249 {
250 shz_mat4x4_apply(this, &mat);
251 }
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.

◆ apply() [2/2]

void shz::mat4x4::apply ( const float mat[16])
inlinenoexcept

Definition at line 253 of file shz_matrix.hpp.

253 {
255 }
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.

◆ apply_transpose() [1/2]

void shz::mat4x4::apply_transpose ( const shz_mat4x4_t & mat)
inlinenoexcept

Definition at line 257 of file shz_matrix.hpp.

257 {
258 shz_mat4x4_apply_transpose(this, &mat);
259 }
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.

◆ apply_transpose() [2/2]

void shz::mat4x4::apply_transpose ( const float mat[16])
inlinenoexcept

Definition at line 261 of file shz_matrix.hpp.

261 {
263 }
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.

◆ apply_scale()

void shz::mat4x4::apply_scale ( float x,
float y,
float z )
inlinenoexcept

Definition at line 265 of file shz_matrix.hpp.

265 {
266 shz_mat4x4_apply_scale(this, x, y, z);
267 }
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.

◆ apply_translation()

void shz::mat4x4::apply_translation ( float x,
float y,
float z )
inlinenoexcept

Definition at line 269 of file shz_matrix.hpp.

269 {
270 shz_mat4x4_apply_translation(this, x, y, z);
271 }
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.

◆ apply_rotation_x()

void shz::mat4x4::apply_rotation_x ( float angle)
inlinenoexcept

Definition at line 273 of file shz_matrix.hpp.

273 {
274 shz_mat4x4_apply_rotation_x(this, angle);
275 }
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...

◆ apply_rotation_y()

void shz::mat4x4::apply_rotation_y ( float angle)
inlinenoexcept

Definition at line 277 of file shz_matrix.hpp.

277 {
278 shz_mat4x4_apply_rotation_y(this, angle);
279 }
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...

◆ apply_rotation_z()

void shz::mat4x4::apply_rotation_z ( float angle)
inlinenoexcept

Definition at line 281 of file shz_matrix.hpp.

281 {
282 shz_mat4x4_apply_rotation_z(this, angle);
283 }
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...

◆ apply_rotation_xyz()

void shz::mat4x4::apply_rotation_xyz ( float xAngle,
float yAngle,
float zAngle )
inlinenoexcept

Definition at line 285 of file shz_matrix.hpp.

285 {
286 shz_mat4x4_apply_rotation_xyz(this, xAngle, yAngle, zAngle);
287 }
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...

◆ apply_rotation_zyx()

void shz::mat4x4::apply_rotation_zyx ( float zAngle,
float yAngle,
float xAngle )
inlinenoexcept

Definition at line 289 of file shz_matrix.hpp.

289 {
290 shz_mat4x4_apply_rotation_zyx(this, zAngle, yAngle, xAngle);
291 }
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...

◆ apply_rotation_zxy()

void shz::mat4x4::apply_rotation_zxy ( float zAngle,
float xAngle,
float yAngle )
inlinenoexcept

Definition at line 293 of file shz_matrix.hpp.

293 {
294 shz_mat4x4_apply_rotation_zxy(this, zAngle, xAngle, yAngle);
295 }
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...

◆ apply_rotation_yxz()

void shz::mat4x4::apply_rotation_yxz ( float yAngle,
float xAngle,
float zAngle )
inlinenoexcept

Definition at line 297 of file shz_matrix.hpp.

297 {
298 shz_mat4x4_apply_rotation_yxz(this, yAngle, xAngle, zAngle);
299 }
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...

◆ apply_rotation() [1/2]

void shz::mat4x4::apply_rotation ( float angle,
float x,
float y,
float z )
inlinenoexcept

Definition at line 301 of file shz_matrix.hpp.

301 {
302 shz_mat4x4_apply_rotation(this, angle, x, y, z);
303 }
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 ...

◆ apply_rotation() [2/2]

void shz::mat4x4::apply_rotation ( quat q)
inlinenoexcept

Definition at line 305 of file shz_matrix.hpp.

305 {
307 }
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...

◆ apply_lookat()

void shz::mat4x4::apply_lookat ( vec3 pos,
vec3 target,
vec3 up )
inlinenoexcept

Definition at line 309 of file shz_matrix.hpp.

309 {
310 shz_mat4x4_apply_lookat(this, pos, target, up);
311 }
void shz_mat4x4_apply_lookat(shz_mat4x4_t *m, shz_vec3_t pos, shz_vec3_t target, shz_vec3_t up) SHZ_NOEXCEPT
Applies the 3D "lookAt" matrix constructed with the given vector components onto the given matrix.
shz_vec4_t pos
Access the last column of the matrix as a 1x4 vector.
Definition shz_matrix.h:82

◆ apply_perspective()

void shz::mat4x4::apply_perspective ( float fov,
float aspect,
float near_z )
inlinenoexcept

Definition at line 313 of file shz_matrix.hpp.

313 {
314 shz_mat4x4_apply_perspective(this, fov, aspect, near_z);
315 }
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...

◆ apply_screen()

void shz::mat4x4::apply_screen ( float width,
float height )
inlinenoexcept

Definition at line 317 of file shz_matrix.hpp.

317 {
318 shz_mat4x4_apply_screen(this, width, height);
319 }
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...

◆ apply_symmetric_skew()

void shz::mat4x4::apply_symmetric_skew ( float x,
float y,
float z )
inlinenoexcept

Definition at line 321 of file shz_matrix.hpp.

321 {
322 shz_mat4x4_apply_symmetric_skew(this, x, y, z);
323 }
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...

◆ apply_permutation_wxyz()

void shz::mat4x4::apply_permutation_wxyz ( )
inlinenoexcept

Definition at line 325 of file shz_matrix.hpp.

325 {
327 }
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...

◆ apply_permutation_yzwx()

void shz::mat4x4::apply_permutation_yzwx ( )
inlinenoexcept

Definition at line 329 of file shz_matrix.hpp.

329 {
331 }
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...

◆ apply_self()

void shz::mat4x4::apply_self ( )
inlinenoexcept

Definition at line 333 of file shz_matrix.hpp.

333 {
335 }
void shz_mat4x4_apply_self(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Multiplies and accumulates the given matrix onto itself.

◆ translate()

void shz::mat4x4::translate ( float x,
float y,
float z )
inlinenoexcept

Definition at line 344 of file shz_matrix.hpp.

344 {
345 shz_mat4x4_translate(this, x, y, z);
346 }
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.

◆ scale()

void shz::mat4x4::scale ( float x,
float y,
float z )
inlinenoexcept

Definition at line 348 of file shz_matrix.hpp.

348 {
349 shz_mat4x4_scale(this, x, y, z);
350 }
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.

◆ rotate_x()

void shz::mat4x4::rotate_x ( float radians)
inlinenoexcept

Definition at line 352 of file shz_matrix.hpp.

352 {
353 shz_mat4x4_rotate_x(this, radians);
354 }
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.

◆ rotate_y()

void shz::mat4x4::rotate_y ( float radians)
inlinenoexcept

Definition at line 356 of file shz_matrix.hpp.

356 {
357 shz_mat4x4_rotate_y(this, radians);
358 }
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.

◆ rotate_z()

void shz::mat4x4::rotate_z ( float radians)
inlinenoexcept

Definition at line 360 of file shz_matrix.hpp.

360 {
361 shz_mat4x4_rotate_z(this, radians);
362 }
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.

◆ rotate_xyz()

void shz::mat4x4::rotate_xyz ( float xRadians,
float yRadians,
float zRadians )
inlinenoexcept

Definition at line 364 of file shz_matrix.hpp.

364 {
365 shz_mat4x4_rotate_xyz(this, xRadians, yRadians, zRadians);
366 }
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.

◆ rotate_zyx()

void shz::mat4x4::rotate_zyx ( float zRadians,
float yRadians,
float xRadians )
inlinenoexcept

Definition at line 368 of file shz_matrix.hpp.

368 {
369 shz_mat4x4_rotate_zyx(this, zRadians, yRadians, xRadians);
370 }
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.

◆ rotate_zxy()

void shz::mat4x4::rotate_zxy ( float zRadians,
float xRadians,
float yRadians )
inlinenoexcept

Definition at line 372 of file shz_matrix.hpp.

372 {
373 shz_mat4x4_rotate_zxy(this, zRadians, xRadians, yRadians);
374 }
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.

◆ rotate_yxz()

void shz::mat4x4::rotate_yxz ( float yRadians,
float xRadians,
float zRadians )
inlinenoexcept

Definition at line 376 of file shz_matrix.hpp.

376 {
377 shz_mat4x4_rotate_yxz(this, yRadians, xRadians, zRadians);
378 }
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.

◆ rotate()

void shz::mat4x4::rotate ( float radians,
float xAxis,
float yAxis,
float zAxis )
inlinenoexcept

Definition at line 380 of file shz_matrix.hpp.

380 {
381 shz_mat4x4_rotate(this, radians, xAxis, yAxis, zAxis);
382 }
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.

◆ mult() [1/2]

static void shz::mat4x4::mult ( mat4x4 * dst,
const mat4x4 & lhs,
const mat4x4 & rhs )
inlinestaticnoexcept

Definition at line 391 of file shz_matrix.hpp.

391 {
392 shz_mat4x4_mult(dst, &lhs, &rhs);
393 }
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.

◆ mult() [2/2]

static void shz::mat4x4::mult ( mat4x4 * dst,
const mat4x4 & lhs,
const float rhs[16] )
inlinestaticnoexcept

Definition at line 395 of file shz_matrix.hpp.

395 {
396 shz_mat4x4_mult_unaligned(dst, &lhs, rhs);
397 }
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,...

◆ transform() [1/3]

vec2 shz::mat4x4::transform ( vec2 in) const
inlinenoexcept

Definition at line 399 of file shz_matrix.hpp.

399 {
400 return shz_mat4x4_transform_vec2(this, in);
401 }
shz_vec2_t shz_mat4x4_transform_vec2(const shz_mat4x4_t *m, shz_vec2_t v) SHZ_NOEXCEPT
Transforms a 2D vector by a 4x4 matrix.

◆ transform() [2/3]

vec3 shz::mat4x4::transform ( vec3 in) const
inlinenoexcept

Definition at line 403 of file shz_matrix.hpp.

403 {
404 return shz_mat4x4_transform_vec3(this, in);
405 }
shz_vec3_t shz_mat4x4_transform_vec3(const shz_mat4x4_t *m, shz_vec3_t v) SHZ_NOEXCEPT
Transforms a 3D vector by a 4x4 matrix.

◆ transform() [3/3]

vec4 shz::mat4x4::transform ( vec4 in) const
inlinenoexcept

Definition at line 407 of file shz_matrix.hpp.

407 {
408 return shz_mat4x4_transform_vec4(this, in);
409 }
shz_vec4_t shz_mat4x4_transform_vec4(const shz_mat4x4_t *mat, shz_vec4_t in) SHZ_NOEXCEPT
Transforms a 4D vector by a 4x4 matrix.

◆ transform_point() [1/2]

vec2 shz::mat4x4::transform_point ( vec2 pt) const
inlinenoexcept

Definition at line 411 of file shz_matrix.hpp.

411 {
412 return shz_mat4x4_transform_point2(this, pt);
413 }
shz_vec2_t shz_mat4x4_transform_point2(const shz_mat4x4_t *mat, shz_vec2_t pt) SHZ_NOEXCEPT
Transforms a 2D point by a 4x4 matrix.

◆ transform_point() [2/2]

vec3 shz::mat4x4::transform_point ( vec3 pt) const
inlinenoexcept

Definition at line 415 of file shz_matrix.hpp.

415 {
416 return shz_mat4x4_transform_point3(this, pt);
417 }
shz_vec3_t shz_mat4x4_transform_point3(const shz_mat4x4_t *mat, shz_vec3_t pt) SHZ_NOEXCEPT
Transforms a 3D point by a 4x4 matrix.

◆ transform_transpose() [1/3]

vec2 shz::mat4x4::transform_transpose ( vec2 in) const
inlinenoexcept

Definition at line 419 of file shz_matrix.hpp.

419 {
421 }
shz_vec2_t shz_mat4x4_transform_vec2_transpose(const shz_mat4x4_t *m, shz_vec2_t v) SHZ_NOEXCEPT
Transforms a 2D vector the the transpose of a 4x4 matrix.

◆ transform_transpose() [2/3]

vec3 shz::mat4x4::transform_transpose ( vec3 in) const
inlinenoexcept

Definition at line 423 of file shz_matrix.hpp.

423 {
425 }
shz_vec3_t shz_mat4x4_transform_vec3_transpose(const shz_mat4x4_t *m, shz_vec3_t v) SHZ_NOEXCEPT
Transforms a 3D vector the the transpose of a 4x4 matrix.

◆ transform_transpose() [3/3]

vec4 shz::mat4x4::transform_transpose ( vec4 in) const
inlinenoexcept

Definition at line 427 of file shz_matrix.hpp.

427 {
429 }
shz_vec4_t shz_mat4x4_transform_vec4_transpose(const shz_mat4x4_t *m, shz_vec4_t v) SHZ_NOEXCEPT
Transforms a 4D vector the the transpose of a 4x4 matrix.

◆ transform_point_transpose() [1/2]

vec2 shz::mat4x4::transform_point_transpose ( vec2 pt) const
inlinenoexcept

Definition at line 431 of file shz_matrix.hpp.

431 {
433 }
shz_vec2_t shz_mat4x4_transform_point2_transpose(const shz_mat4x4_t *mat, shz_vec2_t pt) SHZ_NOEXCEPT
Transforms a 2D point by the transpose of a 4x4 matrix.

◆ transform_point_transpose() [2/2]

vec3 shz::mat4x4::transform_point_transpose ( vec3 pt) const
inlinenoexcept

Definition at line 435 of file shz_matrix.hpp.

435 {
437 }
shz_vec3_t shz_mat4x4_transform_point3_transpose(const shz_mat4x4_t *mat, shz_vec3_t pt) SHZ_NOEXCEPT
Transforms a 3D point by the transpose of a 4x4 matrix.

◆ copy() [1/2]

static void shz::mat4x4::copy ( shz_mat4x4_t * lhs,
const shz_mat4x4_t & rhs )
inlinestaticnoexcept

Definition at line 446 of file shz_matrix.hpp.

446 {
447 shz_mat4x4_copy(lhs, &rhs);
448 }
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.

◆ copy() [2/2]

static void shz::mat4x4::copy ( shz_mat4x4_t * lhs,
const float rhs[16] )
inlinestaticnoexcept

Definition at line 450 of file shz_matrix.hpp.

450 {
452 }
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.

◆ to_quat()

quat shz::mat4x4::to_quat ( ) const
inlinenoexcept

Definition at line 454 of file shz_matrix.hpp.

454 {
455 return shz_mat4x4_to_quat(this);
456 }
shz_quat_t shz_mat4x4_to_quat(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Converts the given 4x4 orientation matrix into a quaternion.

◆ determinant()

float shz::mat4x4::determinant ( ) const
inlinenoexcept

Definition at line 458 of file shz_matrix.hpp.

458 {
459 return shz_mat4x4_determinant(this);
460 }
float shz_mat4x4_determinant(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Returns the determinant of the given 4x4 matrix.

◆ trace()

float shz::mat4x4::trace ( ) const
inlinenoexcept

Definition at line 462 of file shz_matrix.hpp.

462 {
463 return shz_mat4x4_trace(this);
464 }
float shz_mat4x4_trace(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Returns the trace of the given 4x4 matrix.

◆ inverse()

void shz::mat4x4::inverse ( mat4x4 * out) const
inlinenoexcept

Definition at line 466 of file shz_matrix.hpp.

466 {
467 shz_mat4x4_inverse(this, out);
468 }
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.

◆ inverse_block_triangular()

void shz::mat4x4::inverse_block_triangular ( mat4x4 * out) const
inlinenoexcept

Definition at line 470 of file shz_matrix.hpp.

470 {
472 }
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.

◆ decompose()

void shz::mat4x4::decompose ( vec3 * translation,
quat * rotation,
vec3 * scale ) const
inlinenoexcept

Definition at line 474 of file shz_matrix.hpp.

474 {
475 shz_mat4x4_decompose(this, translation, rotation, scale);
476 }
void shz_mat4x4_decompose(const shz_mat4x4_t *mat, shz_vec3_t *translation, shz_quat_t *rotation, shz_vec3_t *scale) SHZ_NOEXCEPT
Decomposes a 4x4 transform matrix into translation, rotation, and scale.

Friends And Related Symbol Documentation

◆ operator==

auto operator== ( const mat4x4 & lhs,
const mat4x4 & rhs )
friend

Overloaded equality operator, for comparing vectors.

Definition at line 68 of file shz_matrix.hpp.

68 {
69 return shz_mat4x4_equal(&lhs, &rhs);
70 }
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.

Field Documentation

◆ Rows

size_t shz::mat4x4::Rows
staticconstexpr

Number of rows.

Definition at line 29 of file shz_matrix.hpp.

◆ Cols

size_t shz::mat4x4::Cols
staticconstexpr

Number of columns.

Definition at line 30 of file shz_matrix.hpp.


The documentation for this struct was generated from the following file: