SH4ZAM! 0.8.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

 mat4x4 (const mat4x4 &other) noexcept
 
 mat4x4 (const shz_mat4x4_t &other) noexcept
 
mat4x4operator= (const shz_mat4x4_t &other) noexcept
 
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_translation (const vec3 &v) noexcept
 
void init_scale (float x, float y, float z) noexcept
 
void init_scale (const vec3 &v) 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 (float angle, const vec3 &axis) noexcept
 
void init_rotation_dir (float angle, float x, float y, float z) noexcept
 
void init_rotation_dir (float angle, const vec3 &dir) noexcept
 
void init_rotation (const quat &q) noexcept
 
void init_diagonal (float x, float y, float z, float w) noexcept
 
void init_diagonal (const vec4 &v) noexcept
 
void init_upper_triangular (float col1, const vec2 &col2, const vec3 &col3, const vec4 &col4) noexcept
 
void init_lower_triangular (const vec4 &col1, const vec3 &col2, const vec2 &col3, float col4) noexcept
 
void init_symmetric_skew (float x, float y, float z) noexcept
 
void init_symmetric_skew (const vec3 &v) noexcept
 
void init_outer_product (const vec4 &v1, const vec4 &v2) noexcept
 
void init_permutation_wxyz () noexcept
 
void init_permutation_yzwx () noexcept
 
void init_screen (float width, float height) noexcept
 
void init_lookat (const vec3 &eye, const vec3 &center, const vec3 &up) noexcept
 
void init_ortho (float left, float right, float bottom, float top, float znear, float zfar) noexcept
 
void init_frustum (float left, float right, float bottom, float top, float znear, float zfar) noexcept
 
void init_perspective (float fov, float aspect, float znear) noexcept
 
Getting

Routines for getting specific values within a matrix

vec4 row (size_t index) const noexcept
 
vec4 col (size_t index) const noexcept
 
vec3 get_translation () const noexcept
 
vec3 get_scale () 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_translation (const vec3 &v) noexcept
 
void set_scale (float x, float y, float z) noexcept
 
void set_scale (const vec3 &v) noexcept
 
void set_rotation (const quat &rot) noexcept
 
void set_diagonal (float x, float y, float z, float w) noexcept
 
void set_diagonal (const vec4 &v) 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_scale (const vec3 &v) noexcept
 
void apply_translation (float x, float y, float z) noexcept
 
void apply_translation (const vec3 &v) 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 (float angle, vec3 axis) noexcept
 
void apply_rotation (const quat &q) noexcept
 
void apply_lookat (vec3 pos, vec3 target, vec3 up) noexcept
 
void apply_ortho (float left, float right, float bottom, float top, float znear, float zfar) noexcept
 
void apply_frustum (float left, float right, float bottom, float top, float znear, float zfar) noexcept
 
void apply_perspective (float fov, float aspect, float znear) 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 translate (vec3 v) noexcept
 
void scale (float x, float y, float z) noexcept
 
void scale (vec3 v) 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
 
void rotate (float radians, vec3 axis) noexcept
 
Reverse GL Transformations

Pre-multiplication variants of OpenGL-style 4x4 matrix transforms.

void translate_reverse (float x, float y, float z) noexcept
 
void translate_reverse (const shz::vec3 &pos) noexcept
 
void scale_reverse (float x, float y, float z) noexcept
 
void scale_reverse (const shz::vec3 &size) noexcept
 
Transforming

Routines for transforming vectors and points by a matrix.

vec2 transform (const vec2 &in) const noexcept
 
vec3 transform (const vec3 &in) const noexcept
 
vec4 transform (const vec4 &in) const noexcept
 
vec2 transform_point (const vec2 &pt) const noexcept
 
vec3 transform_point (const vec3 &pt) const noexcept
 
vec2 transform_transpose (const vec2 &in) const noexcept
 
vec3 transform_transpose (const vec3 &in) const noexcept
 
vec4 transform_transpose (const vec4 &in) const noexcept
 
vec2 transform_point_transpose (const vec2 &pt) const noexcept
 
vec3 transform_point_transpose (const vec3 &pt) const noexcept
 

Static Public Member Functions

Multiplication

Routines for multiplying two matrices and storing the result in a third.

static void mult (shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const shz_mat4x4_t &rhs) noexcept
 
static void mult (shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const float rhs[16]) noexcept
 
static void mult_transpose (shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const shz_mat4x4_t &rhs) noexcept
 
static void mult_transpose (shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const float rhs[16]) noexcept
 

Static Public Attributes

static constexpr size_t Rows
 
static constexpr size_t Cols
 

Friends

bool operator== (const mat4x4 &lhs, const mat4x4 &rhs) 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
 
void blend (const shz_mat4x4_t &joint_matrix, float weight) noexcept
 
void swap (shz_mat4x4_t &matA, shz_mat4x4_t &matB) 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 27 of file shz_matrix.hpp.

Constructor & Destructor Documentation

◆ mat4x4() [1/2]

shz::mat4x4::mat4x4 ( const mat4x4 & other)
inlinenoexcept

Definition at line 33 of file shz_matrix.hpp.

33 {
34 shz_mat4x4_copy(this, &other);
35 }
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.

◆ mat4x4() [2/2]

shz::mat4x4::mat4x4 ( const shz_mat4x4_t & other)
inlinenoexcept

Definition at line 37 of file shz_matrix.hpp.

37 {
38 shz_mat4x4_copy(this, &other);
39 }

Member Function Documentation

◆ operator=()

mat4x4 & shz::mat4x4::operator= ( const shz_mat4x4_t & other)
inlinenoexcept

Definition at line 79 of file shz_matrix.hpp.

79 {
80 shz_mat4x4_copy(this, &other);
81 return *this;
82 }

◆ init_identity()

void shz::mat4x4::init_identity ( )
inlinenoexcept

Definition at line 89 of file shz_matrix.hpp.

89 {
91 }
void shz_mat4x4_init_identity(shz_mat4x4_t *mat) SHZ_NOEXCEPT
Initializes the given matrix to the 4x4 identity matrix.

◆ init_identity_safe()

void shz::mat4x4::init_identity_safe ( )
inlinenoexcept

Definition at line 94 of file shz_matrix.hpp.

94 {
96 }

◆ init_zero()

void shz::mat4x4::init_zero ( )
inlinenoexcept

Definition at line 98 of file shz_matrix.hpp.

98 {
100 }
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 102 of file shz_matrix.hpp.

102 {
104 }
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 106 of file shz_matrix.hpp.

106 {
107 shz_mat4x4_init_fill(this, value);
108 }
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() [1/2]

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

Definition at line 110 of file shz_matrix.hpp.

110 {
111 shz_mat4x4_init_translation(this, x, y, z);
112 }
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_translation() [2/2]

void shz::mat4x4::init_translation ( const vec3 & v)
inlinenoexcept

Definition at line 114 of file shz_matrix.hpp.

114 {
115 init_translation(v.x, v.y, v.z);
116 }

◆ init_scale() [1/2]

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

Definition at line 118 of file shz_matrix.hpp.

118 {
119 shz_mat4x4_init_scale(this, x, y, z);
120 }
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_scale() [2/2]

void shz::mat4x4::init_scale ( const vec3 & v)
inlinenoexcept

Definition at line 122 of file shz_matrix.hpp.

122 {
123 init_scale(v.x, v.y, v.z);
124 }

◆ init_rotation_x()

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

Definition at line 126 of file shz_matrix.hpp.

126 {
127 shz_mat4x4_init_rotation_x(this, angle);
128 }
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 130 of file shz_matrix.hpp.

130 {
131 shz_mat4x4_init_rotation_y(this, angle);
132 }
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 134 of file shz_matrix.hpp.

134 {
135 shz_mat4x4_init_rotation_z(this, angle);
136 }
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 138 of file shz_matrix.hpp.

138 {
139 shz_mat4x4_init_rotation_xyz(this, xAngle, yAngle, zAngle);
140 }
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 142 of file shz_matrix.hpp.

142 {
143 shz_mat4x4_init_rotation_zyx(this, zAngle, yAngle, xAngle);
144 }
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 146 of file shz_matrix.hpp.

146 {
147 shz_mat4x4_init_rotation_zxy(this, zAngle, xAngle, yAngle);
148 }
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 150 of file shz_matrix.hpp.

150 {
151 shz_mat4x4_init_rotation_yxz(this, yAngle, xAngle, zAngle);
152 }
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/3]

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

Definition at line 154 of file shz_matrix.hpp.

154 {
155 shz_mat4x4_init_rotation(this, angle, x, y, z);
156 }
void shz_mat4x4_init_rotation(shz_mat4x4_t *mat, float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Initializes the given 4x4 matrix to a 3D rotation matrix of angle radians about the vector with the g...

◆ init_rotation() [2/3]

void shz::mat4x4::init_rotation ( float angle,
const vec3 & axis )
inlinenoexcept

Definition at line 158 of file shz_matrix.hpp.

158 {
159 init_rotation(angle, axis.x, axis.y, axis.z);
160 }

◆ init_rotation_dir() [1/2]

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

Definition at line 162 of file shz_matrix.hpp.

162 {
163 shz_mat4x4_init_rotation_dir(this, angle, x, y, z);
164 }
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 dir...

◆ init_rotation_dir() [2/2]

void shz::mat4x4::init_rotation_dir ( float angle,
const vec3 & dir )
inlinenoexcept

Definition at line 166 of file shz_matrix.hpp.

166 {
167 init_rotation_dir(angle, dir.x, dir.y, dir.z);
168 }

◆ init_rotation() [3/3]

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

Definition at line 170 of file shz_matrix.hpp.

170 {
172 }
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() [1/2]

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

Definition at line 174 of file shz_matrix.hpp.

174 {
175 shz_mat4x4_init_diagonal(this, x, y, z, w);
176 }
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_diagonal() [2/2]

void shz::mat4x4::init_diagonal ( const vec4 & v)
inlinenoexcept

Definition at line 178 of file shz_matrix.hpp.

178 {
179 init_diagonal(v.x, v.y, v.z, v.w);
180 }

◆ init_upper_triangular()

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

Definition at line 182 of file shz_matrix.hpp.

182 {
183 shz_mat4x4_init_upper_triangular(this, col1, col2, col3, col4);
184 }
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 ( const vec4 & col1,
const vec3 & col2,
const vec2 & col3,
float col4 )
inlinenoexcept

Definition at line 186 of file shz_matrix.hpp.

186 {
187 shz_mat4x4_init_lower_triangular(this, col1, col2, col3, col4);
188 }
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() [1/2]

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

Definition at line 190 of file shz_matrix.hpp.

190 {
191 shz_mat4x4_init_symmetric_skew(this, x, y, z);
192 }
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_symmetric_skew() [2/2]

void shz::mat4x4::init_symmetric_skew ( const vec3 & v)
inlinenoexcept

Definition at line 194 of file shz_matrix.hpp.

194 {
195 init_symmetric_skew(v.x, v.y, v.z);
196 }

◆ init_outer_product()

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

Definition at line 198 of file shz_matrix.hpp.

198 {
199 shz_mat4x4_init_outer_product(this, v1, v2);
200 }
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 202 of file shz_matrix.hpp.

202 {
204 }
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 206 of file shz_matrix.hpp.

206 {
208 }
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 210 of file shz_matrix.hpp.

210 {
211 shz_mat4x4_init_screen(this, width, height);
212 }
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 ( const vec3 & eye,
const vec3 & center,
const vec3 & up )
inlinenoexcept

Definition at line 214 of file shz_matrix.hpp.

214 {
215 shz_mat4x4_init_lookat(this, eye, center, up);
216 }
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:76

◆ init_ortho()

void shz::mat4x4::init_ortho ( float left,
float right,
float bottom,
float top,
float znear,
float zfar )
inlinenoexcept

Definition at line 218 of file shz_matrix.hpp.

218 {
219 shz_mat4x4_init_ortho(this, left, right, bottom, top, znear, zfar);
220 }
void shz_mat4x4_init_ortho(shz_mat4x4_t *mat, float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Initializes the given matrix to an orthographic projection matrix.
shz_vec4_t left
< Named column vectors.
Definition shz_matrix.h:75

◆ init_frustum()

void shz::mat4x4::init_frustum ( float left,
float right,
float bottom,
float top,
float znear,
float zfar )
inlinenoexcept

Definition at line 222 of file shz_matrix.hpp.

222 {
223 shz_mat4x4_init_frustum(this, left, right, bottom, top, znear, zfar);
224 }
void shz_mat4x4_init_frustum(shz_mat4x4_t *mat, float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Initializes the given matrix to a frustum projection matrix.

◆ init_perspective()

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

Definition at line 226 of file shz_matrix.hpp.

226 {
227 shz_mat4x4_init_perspective(this, fov, aspect, znear);
228 }
void shz_mat4x4_init_perspective(shz_mat4x4_t *mat, float fov, float aspect, float znear) 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 238 of file shz_matrix.hpp.

238 {
239 return shz_mat4x4_row(this, index);
240 }
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 243 of file shz_matrix.hpp.

243 {
244 return shz_mat4x4_col(this, index);
245 }
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.

◆ get_translation()

vec3 shz::mat4x4::get_translation ( ) const
inlinenoexcept

Definition at line 247 of file shz_matrix.hpp.

247 {
248 return shz_mat4x4_get_translation(this);
249 }
shz_vec3_t shz_mat4x4_get_translation(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Returns the translational components from the 4th column as a 3D vector.

◆ get_scale()

vec3 shz::mat4x4::get_scale ( ) const
inlinenoexcept

Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.

Warning
This routine assumes XMTRX is a standard TRS-style transform matrix, without shearing or reflection.

Definition at line 256 of file shz_matrix.hpp.

256 {
257 return shz_mat4x4_get_scale(this);
258 }
shz_vec3_t shz_mat4x4_get_scale(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Exracts the 3D scale factors from the given 4x4 matrix.

◆ set_row()

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

Definition at line 267 of file shz_matrix.hpp.

267 {
268 shz_mat4x4_set_row(this, index, values);
269 }
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 271 of file shz_matrix.hpp.

271 {
272 shz_mat4x4_set_col(this, index, values);
273 }
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 275 of file shz_matrix.hpp.

275 {
276 shz_mat4x4_swap_rows(this, row1, row2);
277 }
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 279 of file shz_matrix.hpp.

279 {
280 shz_mat4x4_swap_cols(this, col1, col2);
281 }
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() [1/2]

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

Definition at line 283 of file shz_matrix.hpp.

283 {
284 shz_mat4x4_set_translation(this, x, y, z);
285 }
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_translation() [2/2]

void shz::mat4x4::set_translation ( const vec3 & v)
inlinenoexcept

Definition at line 287 of file shz_matrix.hpp.

287 {
288 set_translation(v.x, v.y, v.z);
289 }

◆ set_scale() [1/2]

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

Definition at line 291 of file shz_matrix.hpp.

291 {
292 shz_mat4x4_set_scale(this, x, y, z);
293 }
void shz_mat4x4_set_scale(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Assigns only the 3D scale-related elements of the given matrix to the given values.

◆ set_scale() [2/2]

void shz::mat4x4::set_scale ( const vec3 & v)
inlinenoexcept

Definition at line 295 of file shz_matrix.hpp.

295 {
296 set_scale(v.x, v.y, v.z);
297 }

◆ set_rotation()

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

Definition at line 299 of file shz_matrix.hpp.

299 {
301 }
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() [1/2]

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

Definition at line 303 of file shz_matrix.hpp.

303 {
304 shz_mat4x4_set_diagonal(this, x, y, z, w);
305 }
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.

◆ set_diagonal() [2/2]

void shz::mat4x4::set_diagonal ( const vec4 & v)
inlinenoexcept

Definition at line 307 of file shz_matrix.hpp.

307 {
308 set_diagonal(v.x, v.y, v.z, v.w);
309 }

◆ apply() [1/2]

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

Definition at line 318 of file shz_matrix.hpp.

318 {
319 shz_mat4x4_apply(this, &mat);
320 }
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 322 of file shz_matrix.hpp.

322 {
324 }
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 326 of file shz_matrix.hpp.

326 {
327 shz_mat4x4_apply_transpose(this, &mat);
328 }
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 330 of file shz_matrix.hpp.

330 {
332 }
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() [1/2]

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

Definition at line 334 of file shz_matrix.hpp.

334 {
335 shz_mat4x4_apply_scale(this, x, y, z);
336 }
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_scale() [2/2]

void shz::mat4x4::apply_scale ( const vec3 & v)
inlinenoexcept

Definition at line 338 of file shz_matrix.hpp.

338 {
339 apply_scale(v.x, v.y, v.z);
340 }

◆ apply_translation() [1/2]

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

Definition at line 342 of file shz_matrix.hpp.

342 {
343 shz_mat4x4_apply_translation(this, x, y, z);
344 }
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_translation() [2/2]

void shz::mat4x4::apply_translation ( const vec3 & v)
inlinenoexcept

Definition at line 346 of file shz_matrix.hpp.

346 {
347 apply_translation(v.x, v.y, v.z);
348 }

◆ apply_rotation_x()

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

Definition at line 350 of file shz_matrix.hpp.

350 {
351 shz_mat4x4_apply_rotation_x(this, angle);
352 }
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 354 of file shz_matrix.hpp.

354 {
355 shz_mat4x4_apply_rotation_y(this, angle);
356 }
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 358 of file shz_matrix.hpp.

358 {
359 shz_mat4x4_apply_rotation_z(this, angle);
360 }
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 362 of file shz_matrix.hpp.

362 {
363 shz_mat4x4_apply_rotation_xyz(this, xAngle, yAngle, zAngle);
364 }
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 366 of file shz_matrix.hpp.

366 {
367 shz_mat4x4_apply_rotation_zyx(this, zAngle, yAngle, xAngle);
368 }
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 370 of file shz_matrix.hpp.

370 {
371 shz_mat4x4_apply_rotation_zxy(this, zAngle, xAngle, yAngle);
372 }
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 374 of file shz_matrix.hpp.

374 {
375 shz_mat4x4_apply_rotation_yxz(this, yAngle, xAngle, zAngle);
376 }
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/3]

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

Definition at line 378 of file shz_matrix.hpp.

378 {
379 shz_mat4x4_apply_rotation(this, angle, x, y, z);
380 }
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/3]

void shz::mat4x4::apply_rotation ( float angle,
vec3 axis )
inlinenoexcept

Definition at line 382 of file shz_matrix.hpp.

382 {
383 apply_rotation(angle, axis.x, axis.y, axis.z);
384 }

◆ apply_rotation() [3/3]

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

Definition at line 386 of file shz_matrix.hpp.

386 {
388 }
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 390 of file shz_matrix.hpp.

390 {
391 shz_mat4x4_apply_lookat(this, pos, target, up);
392 }
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:78

◆ apply_ortho()

void shz::mat4x4::apply_ortho ( float left,
float right,
float bottom,
float top,
float znear,
float zfar )
inlinenoexcept

Definition at line 394 of file shz_matrix.hpp.

394 {
395 shz_mat4x4_apply_ortho(this, left, right, bottom, top, znear, zfar);
396 }
void shz_mat4x4_apply_ortho(shz_mat4x4_t *m, float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Multiplies and accumulates the ortho matrix constructed from the given values onto the given matrix.

◆ apply_frustum()

void shz::mat4x4::apply_frustum ( float left,
float right,
float bottom,
float top,
float znear,
float zfar )
inlinenoexcept

Definition at line 398 of file shz_matrix.hpp.

398 {
399 shz_mat4x4_apply_frustum(this, left, right, bottom, top, znear, zfar);
400 }
void shz_mat4x4_apply_frustum(shz_mat4x4_t *m, float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Multiplies and accumulates the frustum matrix constructed from the given values onto the given matrix...

◆ apply_perspective()

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

Definition at line 402 of file shz_matrix.hpp.

402 {
403 shz_mat4x4_apply_perspective(this, fov, aspect, znear);
404 }
void shz_mat4x4_apply_perspective(shz_mat4x4_t *m, float fov, float aspect, float znear) 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 406 of file shz_matrix.hpp.

406 {
407 shz_mat4x4_apply_screen(this, width, height);
408 }
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 410 of file shz_matrix.hpp.

410 {
411 shz_mat4x4_apply_symmetric_skew(this, x, y, z);
412 }
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 414 of file shz_matrix.hpp.

414 {
416 }
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 418 of file shz_matrix.hpp.

418 {
420 }
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 422 of file shz_matrix.hpp.

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

◆ translate() [1/2]

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

Definition at line 433 of file shz_matrix.hpp.

433 {
434 shz_mat4x4_translate(this, x, y, z);
435 }
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.

◆ translate() [2/2]

void shz::mat4x4::translate ( vec3 v)
inlinenoexcept

Definition at line 437 of file shz_matrix.hpp.

437 {
438 translate(v.x, v.y, v.z);
439 }

◆ scale() [1/2]

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

Definition at line 441 of file shz_matrix.hpp.

441 {
442 shz_mat4x4_scale(this, x, y, z);
443 }
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.

◆ scale() [2/2]

void shz::mat4x4::scale ( vec3 v)
inlinenoexcept

Definition at line 445 of file shz_matrix.hpp.

445 {
446 scale(v.x, v.y, v.z);
447 }

◆ rotate_x()

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

Definition at line 449 of file shz_matrix.hpp.

449 {
450 shz_mat4x4_rotate_x(this, radians);
451 }
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 453 of file shz_matrix.hpp.

453 {
454 shz_mat4x4_rotate_y(this, radians);
455 }
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 457 of file shz_matrix.hpp.

457 {
458 shz_mat4x4_rotate_z(this, radians);
459 }
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 461 of file shz_matrix.hpp.

461 {
462 shz_mat4x4_rotate_xyz(this, xRadians, yRadians, zRadians);
463 }
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 465 of file shz_matrix.hpp.

465 {
466 shz_mat4x4_rotate_zyx(this, zRadians, yRadians, xRadians);
467 }
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 469 of file shz_matrix.hpp.

469 {
470 shz_mat4x4_rotate_zxy(this, zRadians, xRadians, yRadians);
471 }
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 473 of file shz_matrix.hpp.

473 {
474 shz_mat4x4_rotate_yxz(this, yRadians, xRadians, zRadians);
475 }
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() [1/2]

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

Definition at line 477 of file shz_matrix.hpp.

477 {
478 shz_mat4x4_rotate(this, radians, xAxis, yAxis, zAxis);
479 }
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.

◆ rotate() [2/2]

void shz::mat4x4::rotate ( float radians,
vec3 axis )
inlinenoexcept

Definition at line 481 of file shz_matrix.hpp.

481 {
482 rotate(radians, axis.x, axis.y, axis.z);
483 }

◆ translate_reverse() [1/2]

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

Pre-multiplies and accumulates the given matrix onto the 3D translation matrix with the given components.

Warning
This routin clobbers XMTRX.

Definition at line 496 of file shz_matrix.hpp.

496 {
497 shz_mat4x4_translate_reverse(this, x, y, z);
498 }
void shz_mat4x4_translate_reverse(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Pre-multiplies and accumulates the given matrix onto the 3D translation matrix with the given compone...

◆ translate_reverse() [2/2]

void shz::mat4x4::translate_reverse ( const shz::vec3 & pos)
inlinenoexcept

Pre-multiplies and accumulates the given matrix onto the 3D translation matrix with the given position vector.

Warning
This routin clobbers XMTRX.

Definition at line 504 of file shz_matrix.hpp.

504 {
505 translate_reverse(pos.x, pos.y, pos.z);
506 }
void translate_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulates the given matrix onto the 3D translation matrix with the given compone...

◆ scale_reverse() [1/2]

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

Pre-multiplies and accumulates the given matrix onto the 3D scaling matrix with the given components.

Warning
This routine clobbers XMTRX

Definition at line 512 of file shz_matrix.hpp.

512 {
513 shz_mat4x4_scale_reverse(this, x, y, z);
514 }
void shz_mat4x4_scale_reverse(shz_mat4x4_t *mat, float x, float y, float z) SHZ_NOEXCEPT
Pre-multiplies and accumulates the given matrix onto the 3D scaling matrix with the given components.

◆ scale_reverse() [2/2]

void shz::mat4x4::scale_reverse ( const shz::vec3 & size)
inlinenoexcept

Pre-multiplies and accumulates the given matrix onto the 3D scaling matrix with the given size vector.

Warning
This routine clobbers XMTRX

Definition at line 520 of file shz_matrix.hpp.

520 {
521 scale_reverse(size.x, size.y, size.z);
522 }
void scale_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulates the given matrix onto the 3D scaling matrix with the given components.
float y
Y coordinate.
Definition shz_vector.h:64
float x
X coordinate.
Definition shz_vector.h:63
float z
Z coordinate.
Definition shz_vector.h:68

◆ mult() [1/2]

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

Definition at line 531 of file shz_matrix.hpp.

531 {
532 shz_mat4x4_mult(dst, &lhs, &rhs);
533 }
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 ( shz_mat4x4_t * dst,
const shz_mat4x4_t & lhs,
const float rhs[16] )
inlinestaticnoexcept

Definition at line 535 of file shz_matrix.hpp.

535 {
536 shz_mat4x4_mult_unaligned(dst, &lhs, rhs);
537 }
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,...

◆ mult_transpose() [1/2]

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

Definition at line 539 of file shz_matrix.hpp.

539 {
540 shz_mat4x4_mult_transpose(dst, &lhs, &rhs);
541 }
void shz_mat4x4_mult_transpose(shz_mat4x4_t *mat, const shz_mat4x4_t *lhs, const shz_mat4x4_t *rhs) SHZ_NOEXCEPT
Multiplies the regular matrix, lhs, by the transpose of the matrix, rhs, storing the result into mat.

◆ mult_transpose() [2/2]

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

Definition at line 543 of file shz_matrix.hpp.

543 {
545 }
void shz_mat4x4_mult_transpose_unaligned(shz_mat4x4_t *mat, const shz_mat4x4_t *lhs, const float rhs[16]) SHZ_NOEXCEPT
Multiplies the regular matrix, lhs, by the transpose of the unaligned matrix, rhs,...

◆ transform() [1/3]

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

Definition at line 554 of file shz_matrix.hpp.

554 {
555 return shz_mat4x4_transform_vec2(this, in);
556 }
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 ( const vec3 & in) const
inlinenoexcept

Definition at line 558 of file shz_matrix.hpp.

558 {
559 return shz_mat4x4_transform_vec3(this, in);
560 }
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 ( const vec4 & in) const
inlinenoexcept

Definition at line 562 of file shz_matrix.hpp.

562 {
563 return shz_mat4x4_transform_vec4(this, in);
564 }
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 ( const vec2 & pt) const
inlinenoexcept

Definition at line 566 of file shz_matrix.hpp.

566 {
567 return shz_mat4x4_transform_point2(this, pt);
568 }
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 ( const vec3 & pt) const
inlinenoexcept

Definition at line 570 of file shz_matrix.hpp.

570 {
571 return shz_mat4x4_transform_point3(this, pt);
572 }
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 ( const vec2 & in) const
inlinenoexcept

Definition at line 574 of file shz_matrix.hpp.

574 {
576 }
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 ( const vec3 & in) const
inlinenoexcept

Definition at line 578 of file shz_matrix.hpp.

578 {
580 }
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 ( const vec4 & in) const
inlinenoexcept

Definition at line 582 of file shz_matrix.hpp.

582 {
584 }
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 ( const vec2 & pt) const
inlinenoexcept

Definition at line 586 of file shz_matrix.hpp.

586 {
588 }
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 ( const vec3 & pt) const
inlinenoexcept

Definition at line 590 of file shz_matrix.hpp.

590 {
592 }
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 601 of file shz_matrix.hpp.

601 {
602 shz_mat4x4_copy(lhs, &rhs);
603 }

◆ copy() [2/2]

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

Definition at line 605 of file shz_matrix.hpp.

605 {
607 }
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 613 of file shz_matrix.hpp.

613 {
614 return shz_mat4x4_to_quat(this);
615 }
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 617 of file shz_matrix.hpp.

617 {
618 return shz_mat4x4_determinant(this);
619 }
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 621 of file shz_matrix.hpp.

621 {
622 return shz_mat4x4_trace(this);
623 }
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 625 of file shz_matrix.hpp.

625 {
626 shz_mat4x4_inverse(this, out);
627 }
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 629 of file shz_matrix.hpp.

629 {
631 }
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 633 of file shz_matrix.hpp.

633 {
634 shz_mat4x4_decompose(this, translation, rotation, scale);
635 }
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.

◆ blend()

void shz::mat4x4::blend ( const shz_mat4x4_t & joint_matrix,
float weight )
inlinenoexcept

Adds and accumulates a scaled 4x4 matrix into the given matrix.

Each component of joint_matrix will be multiplied by weight, with the result being added to the existing value of that component in dst.

This is useful for accumulating weighted joint matrices onto an initially zeroed-out matrix.

Warning
This routine clobbers XMTRX.
See also
shz_mat4x4_init_zero()

Definition at line 649 of file shz_matrix.hpp.

649 {
650 shz_mat4x4_blend(this, &joint_matrix, weight);
651 }
void shz_mat4x4_blend(shz_mat4x4_t *dst, const shz_mat4x4_t *joint_matrix, float weights) SHZ_NOEXCEPT
Adds and accumulates a scaled 4x4 matrix into the given matrix.

Friends And Related Symbol Documentation

◆ operator==

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

Overloaded equality operator, for comparing vectors.

Definition at line 75 of file shz_matrix.hpp.

75 {
76 return shz_mat4x4_equal(&lhs, &rhs);
77 }
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.

◆ swap

void swap ( shz_mat4x4_t & matA,
shz_mat4x4_t & matB )
friend

Definition at line 609 of file shz_matrix.hpp.

609 {
610 shz_mat4x4_swap(&matA, &matB);
611 }
void shz_mat4x4_swap(shz_mat4x4_t *matA, shz_mat4x4_t *matB) SHZ_NOEXCEPT
Swaps the contents of the two given matrices, matA and matB.

Field Documentation

◆ Rows

size_t shz::mat4x4::Rows
staticconstexpr

Number of rows.

Definition at line 28 of file shz_matrix.hpp.

◆ Cols

size_t shz::mat4x4::Cols
staticconstexpr

Number of columns.

Definition at line 29 of file shz_matrix.hpp.


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