SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
Loading...
Searching...
No Matches
shz_xmtrx.h File Reference
#include "shz_vector.h"
#include "shz_quat.h"
#include "inline/shz_xmtrx.inl.h"
Include dependency graph for shz_xmtrx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  shz_xmtrx_reg {
  SHZ_XMTRX_XF0 , SHZ_XMTRX_XF1 , SHZ_XMTRX_XF2 , SHZ_XMTRX_XF3 ,
  SHZ_XMTRX_XF4 , SHZ_XMTRX_XF5 , SHZ_XMTRX_XF6 , SHZ_XMTRX_XF7 ,
  SHZ_XMTRX_XF8 , SHZ_XMTRX_XF9 , SHZ_XMTRX_XF10 , SHZ_XMTRX_XF11 ,
  SHZ_XMTRX_XF12 , SHZ_XMTRX_XF13 , SHZ_XMTRX_XF14 , SHZ_XMTRX_XF15
}
 

Functions

Accessors

Setting and retrieving individual XMTRX register values.

float shz_xmtrx_read (shz_xmtrx_reg_t xf) SHZ_NOEXCEPT
 
void shz_xmtrx_write (shz_xmtrx_reg_t xf, float value) SHZ_NOEXCEPT
 
shz_vec4_t shz_xmtrx_read_row (unsigned int index) SHZ_NOEXCEPT
 
shz_vec4_t shz_xmtrx_read_col (unsigned int index) SHZ_NOEXCEPT
 
void shz_xmtrx_write_row (unsigned int index, shz_vec4_t vector) SHZ_NOEXCEPT
 
void shz_xmtrx_write_col (unsigned int index, shz_vec4_t vector) SHZ_NOEXCEPT
 
void shz_xmtrx_swap_rows (unsigned int index1, unsigned int index2) SHZ_NOEXCEPT
 
void shz_xmtrx_swap_cols (unsigned int index1, unsigned int index2) SHZ_NOEXCEPT
 
Loading

Routines for loading XMTRX contents from memory.

void shz_xmtrx_load_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_wxyz_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_load_cols_4x4 (const shz_vec4_t *c1, const shz_vec4_t *c2, const shz_vec4_t *c3, const shz_vec4_t *c4) SHZ_NOEXCEPT
 
void shz_xmtrx_load_rows_4x4 (const shz_vec4_t *r1, const shz_vec4_t *r2, const shz_vec4_t *r3, const shz_vec4_t *r4) SHZ_NOEXCEPT
 
void shz_xmtrx_load_transpose_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_transpose_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_load_3x4 (const shz_mat3x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_cols_4x3 (const shz_vec4_t *c1, const shz_vec4_t *c2, const shz_vec4_t *c3) SHZ_NOEXCEPT
 
void shz_xmtrx_load_rows_3x4 (const shz_vec4_t *r1, const shz_vec4_t *r2, const shz_vec4_t *r3) SHZ_NOEXCEPT
 
void shz_xmtrx_load_3x3 (const shz_mat3x3_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_transpose_3x3 (const float *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_load_2x2 (const shz_mat2x2_t *matrix) SHZ_NOEXCEPT
 
Storing

Routines for saving XMTRX contents to memory.

void shz_xmtrx_store_4x4 (shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_store_unaligned_4x4 (float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_store_transpose_4x4 (shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_store_transpose_unaligned_4x4 (float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_store_3x4 (shz_mat3x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_store_3x3 (shz_mat3x3_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_store_transpose_3x3 (shz_mat3x3_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_store_2x2 (shz_mat2x2_t *matrix) SHZ_NOEXCEPT
 
Initialization

Routines used to initialize the entirety of XMTRX.

void shz_xmtrx_init_identity (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_identity_safe (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_zero (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_one (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_fill (float value) SHZ_NOEXCEPT
 
void shz_xmtrx_init_translation (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_init_scale (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_x (float x) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_y (float y) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_z (float z) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_xyz (float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_zyx (float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_zxy (float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_yxz (float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation (float angle, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
 
void shz_xmtrx_init_diagonal (float x, float y, float z, float w) SHZ_NOEXCEPT
 
void shz_xmtrx_init_upper_triangular (float col1, shz_vec2_t col2, shz_vec3_t col3, shz_vec4_t col4) SHZ_NOEXCEPT
 
void shz_xmtrx_init_lower_triangular (shz_vec4_t col1, shz_vec3_t col2, shz_vec2_t col3, float col4) SHZ_NOEXCEPT
 
void shz_xmtrx_init_symmetric_skew (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_init_outer_product (shz_vec4_t x, shz_vec4_t y) SHZ_NOEXCEPT
 
void shz_xmtrx_init_permutation_wxyz (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_permutation_yzwx (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_screen (float width, float height) SHZ_NOEXCEPT
 
void shz_xmtrx_init_lookat (shz_vec3_t eye, shz_vec3_t center, shz_vec3_t up) SHZ_NOEXCEPT
 
void shz_xmtrx_init_ortho (float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
 
void shz_xmtrx_init_frustum (float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
 
void shz_xmtrx_init_perspective (float fov, float aspect, float near_z) SHZ_NOEXCEPT
 
void shz_xmtrx_init_rotation_quat (shz_quat_t q) SHZ_NOEXCEPT
 
Apply Operation

Updates only relevant values of XMTRX based on the given transform.

void shz_xmtrx_apply_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_transpose_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_transpose_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_reverse_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_reverse_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_reverse_transpose_4x4 (const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_reverse_transpose_unaligned_4x4 (const float matrix[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_3x4 (const shz_mat3x4_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_3x3 (const shz_mat3x3_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_transpose_3x3 (const shz_mat3x3_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_2x2 (const shz_mat2x2_t *matrix) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_translation (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_scale (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_x (float x) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_y (float y) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_z (float z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_xyz (float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_zyx (float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_zxy (float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_yxz (float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation (float angle, float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_rotation_quat (shz_quat_t quat) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_lookat (shz_vec3_t eye, shz_vec3_t center, shz_vec3_t up) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_ortho (float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_frustum (float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_perspective (float fov, float aspect, float near_z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_screen (float width, float height) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_symmetric_skew (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_permutation_wxyz (void) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_permutation_yzwx (void) SHZ_NOEXCEPT
 
void shz_xmtrx_apply_self (void) SHZ_NOEXCEPT
 
GL Transformations

OpenGL-style 4x4 matrix transforms.

void shz_xmtrx_translate (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_scale (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_x (float radians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_y (float radians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_z (float radians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_xyz (float xRadians, float yRadians, float zRadians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_zyx (float zRadians, float yRadians, float xRadians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_zxy (float zRadians, float xRadians, float yRadians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate_yxz (float yRadians, float xRadians, float zRadians) SHZ_NOEXCEPT
 
void shz_xmtrx_rotate (float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
 
Compound Operations

Multiple operations combined into one pipelined transaction.

void shz_xmtrx_load_apply_4x4 (const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) SHZ_NOEXCEPT
 
void shz_xmtrx_load_apply_unaligned_4x4 (const float matrix1[16], const float matrix2[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_load_apply_store_4x4 (shz_mat4x4_t *out, const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) SHZ_NOEXCEPT
 
void shz_xmtrx_load_apply_store_unaligned_4x4 (float out[16], const float matrix1[16], const float matrix2[16]) SHZ_NOEXCEPT
 
void shz_xmtrx_load_apply_store_3x4 (shz_mat3x4_t *out, const shz_mat3x4_t *matrix1, const shz_mat3x4_t *matrix2) SHZ_NOEXCEPT
 
void shz_xmtrx_load_apply_store_3x3 (shz_mat3x3_t *out, const shz_mat3x3_t *matrix1, const shz_mat3x3_t *matrix2) SHZ_NOEXCEPT
 
Transformations

Transforming vectors and points against XMTRX.

shz_vec4_t shz_xmtrx_transform_vec4 (shz_vec4_t vec) SHZ_NOEXCEPT
 
shz_vec3_t shz_xmtrx_transform_vec3 (shz_vec3_t vec) SHZ_NOEXCEPT
 
shz_vec2_t shz_xmtrx_transform_vec2 (shz_vec2_t vec) SHZ_NOEXCEPT
 
shz_vec2_t shz_xmtrx_transform_point2 (shz_vec2_t pt) SHZ_NOEXCEPT
 
shz_vec3_t shz_xmtrx_transform_point3 (shz_vec3_t pt) SHZ_NOEXCEPT
 
Setters

Sets the values of related XMTRX components.

void shz_xmtrx_set_translation (float x, float y, float z) SHZ_NOEXCEPT
 
Miscellaneous

Random operations and conversions on XMTRX.

void shz_xmtrx_add_4x4 (const shz_mat4x4_t *mat) SHZ_NOEXCEPT
 
void shz_xmtrx_sub_4x4 (const shz_mat4x4_t *mat) SHZ_NOEXCEPT
 
void shz_xmtrx_add_symmetric_skew (float x, float y, float z) SHZ_NOEXCEPT
 
void shz_xmtrx_add_diagonal (float x, float y, float z, float w) SHZ_NOEXCEPT
 
void shz_xmtrx_transpose (void) SHZ_NOEXCEPT
 
void shz_xmtrx_negate (void) SHZ_NOEXCEPT
 
void shz_xmtrx_abs (void) SHZ_NOEXCEPT
 
void shz_xmtrx_init_fft_weights (float radians) SHZ_NOEXCEPT
 
shz_quat_t shz_xmtrx_to_quat (void) SHZ_NOEXCEPT
 
float shz_xmtrx_determinant (void) SHZ_NOEXCEPT
 
void shz_xmtrx_invert (void) SHZ_NOEXCEPT
 

Detailed Description

Active Matrix API.

This file provides an API built around manipulating and performing calculations using the SH4's "current" 4x4 matrix, which is held within a secondary back-bank of 16 single-precision floating-point registers.

Todo
Author
2025, 2026 Falco Girgis
2025 Twada
2026 TapamN

Definition in file shz_xmtrx.h.

Enumeration Type Documentation

◆ shz_xmtrx_reg

Registers comprising XMTRX, in the FPU back-bank.

Enumerator
SHZ_XMTRX_XF0 

FP register xf0.

SHZ_XMTRX_XF1 

FP register xf1.

SHZ_XMTRX_XF2 

FP register xf2.

SHZ_XMTRX_XF3 

FP register xf3.

SHZ_XMTRX_XF4 

FP register xf4.

SHZ_XMTRX_XF5 

FP register xf5.

SHZ_XMTRX_XF6 

FP register xf6.

SHZ_XMTRX_XF7 

FP register xf7.

SHZ_XMTRX_XF8 

FP register xf8.

SHZ_XMTRX_XF9 

FP register xf9.

SHZ_XMTRX_XF10 

FP register xf10.

SHZ_XMTRX_XF11 

FP register xf11.

SHZ_XMTRX_XF12 

FP register xf12.

SHZ_XMTRX_XF13 

FP register xf13.

SHZ_XMTRX_XF14 

FP register xf14.

SHZ_XMTRX_XF15 

FP register xf15.

Definition at line 64 of file shz_xmtrx.h.

64 {
65 SHZ_XMTRX_XF0, //!< FP register `xf0`.
66 SHZ_XMTRX_XF1, //!< FP register `xf1`.
67 SHZ_XMTRX_XF2, //!< FP register `xf2`.
68 SHZ_XMTRX_XF3, //!< FP register `xf3`.
69 SHZ_XMTRX_XF4, //!< FP register `xf4`.
70 SHZ_XMTRX_XF5, //!< FP register `xf5`.
71 SHZ_XMTRX_XF6, //!< FP register `xf6`.
72 SHZ_XMTRX_XF7, //!< FP register `xf7`.
73 SHZ_XMTRX_XF8, //!< FP register `xf8`.
74 SHZ_XMTRX_XF9, //!< FP register `xf9`.
75 SHZ_XMTRX_XF10, //!< FP register `xf10`.
76 SHZ_XMTRX_XF11, //!< FP register `xf11`.
77 SHZ_XMTRX_XF12, //!< FP register `xf12`.
78 SHZ_XMTRX_XF13, //!< FP register `xf13`.
79 SHZ_XMTRX_XF14, //!< FP register `xf14`.
80 SHZ_XMTRX_XF15 //!< FP register `xf15`.
81} shz_xmtrx_reg_t, shz_xmtrx_reg;
shz_xmtrx_reg
Registers comprising XMTRX, in the FPU back-bank.
Definition shz_xmtrx.h:64
@ SHZ_XMTRX_XF8
FP register xf8.
Definition shz_xmtrx.h:73
@ SHZ_XMTRX_XF9
FP register xf9.
Definition shz_xmtrx.h:74
@ SHZ_XMTRX_XF12
FP register xf12.
Definition shz_xmtrx.h:77
@ SHZ_XMTRX_XF11
FP register xf11.
Definition shz_xmtrx.h:76
@ SHZ_XMTRX_XF14
FP register xf14.
Definition shz_xmtrx.h:79
@ SHZ_XMTRX_XF3
FP register xf3.
Definition shz_xmtrx.h:68
@ SHZ_XMTRX_XF6
FP register xf6.
Definition shz_xmtrx.h:71
@ SHZ_XMTRX_XF4
FP register xf4.
Definition shz_xmtrx.h:69
@ SHZ_XMTRX_XF13
FP register xf13.
Definition shz_xmtrx.h:78
@ SHZ_XMTRX_XF10
FP register xf10.
Definition shz_xmtrx.h:75
@ SHZ_XMTRX_XF2
FP register xf2.
Definition shz_xmtrx.h:67
@ SHZ_XMTRX_XF0
FP register xf0.
Definition shz_xmtrx.h:65
@ SHZ_XMTRX_XF5
FP register xf5.
Definition shz_xmtrx.h:70
@ SHZ_XMTRX_XF7
FP register xf7.
Definition shz_xmtrx.h:72
@ SHZ_XMTRX_XF15
FP register xf15.
Definition shz_xmtrx.h:80
@ SHZ_XMTRX_XF1
FP register xf1.
Definition shz_xmtrx.h:66

Function Documentation

◆ shz_xmtrx_read()

float shz_xmtrx_read ( shz_xmtrx_reg_t xf)

Returns the floating-point value held within the given XMTRX register.

◆ shz_xmtrx_write()

void shz_xmtrx_write ( shz_xmtrx_reg_t xf,
float value )

Sets the floating-point value held within the given XMTRX register to value.

◆ shz_xmtrx_read_row()

shz_vec4_t shz_xmtrx_read_row ( unsigned int index)

Returns the values at the the given row index, as a 4D vector.

◆ shz_xmtrx_read_col()

shz_vec4_t shz_xmtrx_read_col ( unsigned int index)

Returns the values at the given column index, as a 4D vector.

◆ shz_xmtrx_write_row()

void shz_xmtrx_write_row ( unsigned int index,
shz_vec4_t vector )

Sets the values at the given row index to the given 4D vector.

◆ shz_xmtrx_write_col()

void shz_xmtrx_write_col ( unsigned int index,
shz_vec4_t vector )

Sets the values at the given column index to the given 4D vector.

◆ shz_xmtrx_swap_rows()

void shz_xmtrx_swap_rows ( unsigned int index1,
unsigned int index2 )

Swaps the values of the rows with the given indices.

◆ shz_xmtrx_swap_cols()

void shz_xmtrx_swap_cols ( unsigned int index1,
unsigned int index2 )

Swaps the values of the columns with the given indices.

◆ shz_xmtrx_load_4x4()

void shz_xmtrx_load_4x4 ( const shz_mat4x4_t * matrix)

Loads the given 4x4 matrix as XMTRX.

◆ shz_xmtrx_load_wxyz_4x4()

void shz_xmtrx_load_wxyz_4x4 ( const shz_mat4x4_t * matrix)

Loads the given 4x4 matrix as XMTRX, with the 4th column for translation being loaded as the first column.

◆ shz_xmtrx_load_unaligned_4x4()

void shz_xmtrx_load_unaligned_4x4 ( const float matrix[16])

Loads the given array of unaligned 16 float values as the 4x4 XMTRX matrix.

◆ shz_xmtrx_load_cols_4x4()

void shz_xmtrx_load_cols_4x4 ( const shz_vec4_t * c1,
const shz_vec4_t * c2,
const shz_vec4_t * c3,
const shz_vec4_t * c4 )

Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D column vectors.

◆ shz_xmtrx_load_rows_4x4()

void shz_xmtrx_load_rows_4x4 ( const shz_vec4_t * r1,
const shz_vec4_t * r2,
const shz_vec4_t * r3,
const shz_vec4_t * r4 )

Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D row vectors.

◆ shz_xmtrx_load_transpose_4x4()

void shz_xmtrx_load_transpose_4x4 ( const shz_mat4x4_t * matrix)

Loads XMTRX with the transpose of the given 4x4 matrix.

◆ shz_xmtrx_load_transpose_unaligned_4x4()

void shz_xmtrx_load_transpose_unaligned_4x4 ( const float matrix[16])

Loads XMTRX with the transpose of the 4x4 matrix created from the given unaligned array of 16 floats.

◆ shz_xmtrx_load_3x4()

void shz_xmtrx_load_3x4 ( const shz_mat3x4_t * matrix)

Loads the given 3x4 matrix into XMTRX, initializing its remaining elements to identity.

◆ shz_xmtrx_load_cols_4x3()

void shz_xmtrx_load_cols_4x3 ( const shz_vec4_t * c1,
const shz_vec4_t * c2,
const shz_vec4_t * c3 )

Loads the 3x4 matrix formed from the given 3 4D column vectors into XMTRX.

All remaining elements are initialized to identity matrix values.

See also
shz_xmtrx_load_rows_3x4()

◆ shz_xmtrx_load_rows_3x4()

void shz_xmtrx_load_rows_3x4 ( const shz_vec4_t * r1,
const shz_vec4_t * r2,
const shz_vec4_t * r3 )

Loads the 3x4 matrix formed from the given 3 4D row vectors into XMTRX.

All remaining elements are initialized to identity matrix values.

See also
shz_xmtrx_load_cols_3x4()

◆ shz_xmtrx_load_3x3()

void shz_xmtrx_load_3x3 ( const shz_mat3x3_t * matrix)

Loads the given 3x3 matrix into XMTRX, initalizing its remaining elements to identity.

◆ shz_xmtrx_load_transpose_3x3()

void shz_xmtrx_load_transpose_3x3 ( const float * matrix)

Loads the transpose of the given 3x3 matrix into XMTRX, initializing its remaining elements to identity.

◆ shz_xmtrx_load_2x2()

void shz_xmtrx_load_2x2 ( const shz_mat2x2_t * matrix)

Loads the given 2x2 matrix into XMTRX, initializing its remaining elements to identity.

◆ shz_xmtrx_store_4x4()

void shz_xmtrx_store_4x4 ( shz_mat4x4_t * matrix)

Stores the current values held within XMTRX into the given 4x4 matrix.

◆ shz_xmtrx_store_unaligned_4x4()

void shz_xmtrx_store_unaligned_4x4 ( float matrix[16])

Stores the current values held within XMTRX into the given unaligned 16-float array.

◆ shz_xmtrx_store_transpose_4x4()

void shz_xmtrx_store_transpose_4x4 ( shz_mat4x4_t * matrix)

Stores the transpose of the current values held within XMTRX into the given 4x4 matrix.

◆ shz_xmtrx_store_transpose_unaligned_4x4()

void shz_xmtrx_store_transpose_unaligned_4x4 ( float matrix[16])

Stores the transpose of the the current values held within XMTRX into the given 16-element float array.

◆ shz_xmtrx_store_3x4()

void shz_xmtrx_store_3x4 ( shz_mat3x4_t * matrix)

Stores the top-left 3x4 values currently held within XMTRX into the given matrix.

◆ shz_xmtrx_store_3x3()

void shz_xmtrx_store_3x3 ( shz_mat3x3_t * matrix)

Stores the top-left 3x3 values currently held within XMTRX into the given matrix.

◆ shz_xmtrx_store_transpose_3x3()

void shz_xmtrx_store_transpose_3x3 ( shz_mat3x3_t * matrix)

Stores the transpose of the top-left 3x3 values currently held within XMTRX into the given matrix.

◆ shz_xmtrx_store_2x2()

void shz_xmtrx_store_2x2 ( shz_mat2x2_t * matrix)

Stores the top-left 2x2 values currently held within XMTRX into the given matrix.

◆ shz_xmtrx_init_identity()

void shz_xmtrx_init_identity ( void )

Quickly initializes XMTRX to be a 4D identity matrix.

Warning
This routine will not properly zero-out NaN values!
See also
shz_xmtrx_init_identity_safe()

◆ shz_xmtrx_init_identity_safe()

void shz_xmtrx_init_identity_safe ( void )

Safely initializes XMTRX to be a 4D identity matrix.

This routine is guaranteed to properly initialize XMTRX, regardless of NaN values.

See also
shz_xmtrx_init_identity()

◆ shz_xmtrx_init_zero()

void shz_xmtrx_init_zero ( void )

Initializes XMTRX to contain the value of 0.0f for each element.

◆ shz_xmtrx_init_one()

void shz_xmtrx_init_one ( void )

Initializes XMTRX to contain the value of 1.0f for each element.

◆ shz_xmtrx_init_fill()

void shz_xmtrx_init_fill ( float value)

Initializes XMTRX to contain the given value for each element.

◆ shz_xmtrx_init_translation()

void shz_xmtrx_init_translation ( float x,
float y,
float z )

Initializes XMTRX to be a 3D translation matrix to the given coordinates.

◆ shz_xmtrx_init_scale()

void shz_xmtrx_init_scale ( float x,
float y,
float z )

Initializes XMTRX to be a 3D scale matrix with the given dimensions.

◆ shz_xmtrx_init_rotation_x()

void shz_xmtrx_init_rotation_x ( float x)

Initializes XMTRX to be a 3D rotation matrix by x radians about the X axis.

◆ shz_xmtrx_init_rotation_y()

void shz_xmtrx_init_rotation_y ( float y)

Initializes XMTRX to be a 3D rotation matrix by y radians about the Y axis.

◆ shz_xmtrx_init_rotation_z()

void shz_xmtrx_init_rotation_z ( float z)

Initializes XMTRX to be a 3D rotation matrix by z radians about the Z axis.

◆ shz_xmtrx_init_rotation_xyz()

void shz_xmtrx_init_rotation_xyz ( float xAngle,
float yAngle,
float zAngle )

Initializes XMTRX to be a 3D X-Y-Z rotation matrix, with the corresponding angles given in radians.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_init_rotation_zyx(), shz_xmtrx_init_rotation_yxz()

◆ shz_xmtrx_init_rotation_zyx()

void shz_xmtrx_init_rotation_zyx ( float zAngle,
float yAngle,
float xAngle )

Initializes XMTRX to be a 3D Z-Y-X rotation matrix, with the corresponding angles given in radians.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_init_rotation_xyz(), shz_xmtrx_init_rotation_yxz()

◆ shz_xmtrx_init_rotation_zxy()

void shz_xmtrx_init_rotation_zxy ( float zAngle,
float xAngle,
float yAngle )

Initializes XMTRX to be a 3D Z-X-Y rotation matrix, with the corresponding angles given in radians.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_init_rotation_zyx(), shz_xmtrx_init_rotation_yxz()

◆ shz_xmtrx_init_rotation_yxz()

void shz_xmtrx_init_rotation_yxz ( float yAngle,
float xAngle,
float zAngle )

Initializes XMTRX to be a 3D Y-X-Z rotation matrix, with the corresponding angles given in radians.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_init_rotation_yxz(), shz_xmtrx_init_rotation_xyz()

◆ shz_xmtrx_init_rotation()

void shz_xmtrx_init_rotation ( float angle,
float xAxis,
float yAxis,
float zAxis )

Initializes XMTRX to a 3D rotation matrix of angle radians about the given axis.

◆ shz_xmtrx_init_diagonal()

void shz_xmtrx_init_diagonal ( float x,
float y,
float z,
float w )

Initializes XMTRX to be a diagonal matrix with the given diagonal values.

◆ shz_xmtrx_init_upper_triangular()

void shz_xmtrx_init_upper_triangular ( float col1,
shz_vec2_t col2,
shz_vec3_t col3,
shz_vec4_t col4 )

Initializes XMTRX to be an upper triangular matrix with the given column values.

◆ shz_xmtrx_init_lower_triangular()

void shz_xmtrx_init_lower_triangular ( shz_vec4_t col1,
shz_vec3_t col2,
shz_vec2_t col3,
float col4 )

Initializes XMTRX to be a lower triangular matrix with the given column values.

◆ shz_xmtrx_init_symmetric_skew()

void shz_xmtrx_init_symmetric_skew ( float x,
float y,
float z )

Initializes XMTRX to be the 3D symmetric skew matrix formed from the given vector components.

◆ shz_xmtrx_init_outer_product()

void shz_xmtrx_init_outer_product ( shz_vec4_t x,
shz_vec4_t y )

Initializes XMTRX to the 4D matrix resulting from taking the outer product of the two 4D vectors.

◆ shz_xmtrx_init_permutation_wxyz()

void shz_xmtrx_init_permutation_wxyz ( void )

Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be in WXYZ order.

◆ shz_xmtrx_init_permutation_yzwx()

void shz_xmtrx_init_permutation_yzwx ( void )

Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be in YZWX order.

◆ shz_xmtrx_init_screen()

void shz_xmtrx_init_screen ( float width,
float height )

Initializes XMTRX to the viewport matrix with the given dimensions.

fr[n + 0] fr[n + 4] fr[n + 8] fr[n + 12]
w*0.5f 0.0f 0.0f w*0.5f
0.0f -h*0.5f 0.0f h*0.5f
0.0f 0.0f 1.0f 0.0f
0.0f 0.0f 0.0f 1.0f

◆ shz_xmtrx_init_lookat()

void shz_xmtrx_init_lookat ( shz_vec3_t eye,
shz_vec3_t center,
shz_vec3_t up )

Initializes XMTRX to a "lookAt" view matrix, equivalent to gluLookAt().

Warning
This routine clobbers any previous XMTRX contents.

◆ shz_xmtrx_init_ortho()

void shz_xmtrx_init_ortho ( float left,
float right,
float bottom,
float top,
float near,
float far )

Initializes XMTRX to an orthographic projection matrix, equivalent to glOrtho().

Warning
This routine clobbers any previous XMTRX contents.

◆ shz_xmtrx_init_frustum()

void shz_xmtrx_init_frustum ( float left,
float right,
float bottom,
float top,
float near,
float far )

Initializes XMTRX to a frustum projection matrix, equivalent to glFrustum().

Warning
This routine clobbers any previous XMTRX contents.

◆ shz_xmtrx_init_perspective()

void shz_xmtrx_init_perspective ( float fov,
float aspect,
float near_z )

Initializes XMTRX to a perspective projection matrix.

Warning
This routine clobbers any previous XMTRX contents.

◆ shz_xmtrx_init_rotation_quat()

void shz_xmtrx_init_rotation_quat ( shz_quat_t q)

Initializes XMTRX to a 3D rotation matrix with its orientation given by a quaternion.

Warning
This routine clobbers any previous XMTRX contents.
This routine is out-of-line.

◆ shz_xmtrx_apply_4x4()

void shz_xmtrx_apply_4x4 ( const shz_mat4x4_t * matrix)

Multiplies and accumulates the given 4x4 matrix onto XMTRX.

◆ shz_xmtrx_apply_unaligned_4x4()

void shz_xmtrx_apply_unaligned_4x4 ( const float matrix[16])

Multiplies and accumulates the given 16-entry float array as a 4x4 matrix onto XMTRX.

◆ shz_xmtrx_apply_transpose_4x4()

void shz_xmtrx_apply_transpose_4x4 ( const shz_mat4x4_t * matrix)

Multiplies and accumulates the transpose of the given 4x4 matrix onto XMTRX.

◆ shz_xmtrx_apply_transpose_unaligned_4x4()

void shz_xmtrx_apply_transpose_unaligned_4x4 ( const float matrix[16])

Multiplies and accumulates the transpose of the given 16-entry float array as a 4x4 matrix onto XMTRX.

◆ shz_xmtrx_apply_reverse_4x4()

void shz_xmtrx_apply_reverse_4x4 ( const shz_mat4x4_t * matrix)

Multiplies and accumulates XMTRX onto matrix, storing the result as XMTRX.

◆ shz_xmtrx_apply_reverse_unaligned_4x4()

void shz_xmtrx_apply_reverse_unaligned_4x4 ( const float matrix[16])

Multiplies and accumulates XMTRX onto the given float array as a 4x4 matrix, storing the result as XMTRX.

◆ shz_xmtrx_apply_reverse_transpose_4x4()

void shz_xmtrx_apply_reverse_transpose_4x4 ( const shz_mat4x4_t * matrix)

Multiplies and accumulates XMTRX onto the transpose of matrix, storing the result as XMTRX.

◆ shz_xmtrx_apply_reverse_transpose_unaligned_4x4()

void shz_xmtrx_apply_reverse_transpose_unaligned_4x4 ( const float matrix[16])

Multiplies and accumulates XMTRX onto the transpose of the given float array as a 4x4 matrix, storing the result as XMTRX.

◆ shz_xmtrx_apply_3x4()

void shz_xmtrx_apply_3x4 ( const shz_mat3x4_t * matrix)

Multiplies and accumulates the given 3x4 matrix onto XMTRX, not modifying other elements.

◆ shz_xmtrx_apply_3x3()

void shz_xmtrx_apply_3x3 ( const shz_mat3x3_t * matrix)

Multiplies and accumulates the given 3x3 matrix onto XMTRX, not modifying other elements.

◆ shz_xmtrx_apply_transpose_3x3()

void shz_xmtrx_apply_transpose_3x3 ( const shz_mat3x3_t * matrix)

Multiplies and accumulateas the transpose of the given 3x3 matrix onto XMTRX, not modifying other elements.

◆ shz_xmtrx_apply_2x2()

void shz_xmtrx_apply_2x2 ( const shz_mat2x2_t * matrix)

Multiplies and accumulates the given 2x2 matrix onto XMTRX, not modifying other elements.

◆ shz_xmtrx_apply_translation()

void shz_xmtrx_apply_translation ( float x,
float y,
float z )

Adds the values of the given 3 components to the 3D translation components of XMTRX.

◆ shz_xmtrx_apply_scale()

void shz_xmtrx_apply_scale ( float x,
float y,
float z )

Multiplies the values of the inner 3x3 matrix by the given 3D scaling terms.

◆ shz_xmtrx_apply_rotation_x()

void shz_xmtrx_apply_rotation_x ( float x)

Transforms the values of the inner 3x3 matrix by a rotation matrix of x radians about the X axis.

◆ shz_xmtrx_apply_rotation_y()

void shz_xmtrx_apply_rotation_y ( float y)

Transforms the values of the inner 3x3 matrix by a rotation matrix of y radians about the Y axis.

◆ shz_xmtrx_apply_rotation_z()

void shz_xmtrx_apply_rotation_z ( float z)

Transforms the values of the inner 3x3 matrix by a rotation matrix of z radians about the Z axis.

◆ shz_xmtrx_apply_rotation_xyz()

void shz_xmtrx_apply_rotation_xyz ( float xAngle,
float yAngle,
float zAngle )

Multiplies and accumulates XMTRX by a 3D X-Y-Z rotation matrix, with the corresponding angles given in radians.

The transform is applied to the inner 3x3 values within XMTRX, preserving the translational components.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_apply_rotation_zyx(), shz_xmtrx_apply_rotation_yxz()

◆ shz_xmtrx_apply_rotation_zyx()

void shz_xmtrx_apply_rotation_zyx ( float zAngle,
float yAngle,
float xAngle )

Multiplies and accumulates XMTRX by a 3D Z-Y-X rotation matrix, with the corresponding angles given in radians.

The transform is applied to the inner 3x3 values within XMTRX, preserving the translational components.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_apply_rotation_xyz(), shz_xmtrx_apply_rotation_yxz()

◆ shz_xmtrx_apply_rotation_zxy()

void shz_xmtrx_apply_rotation_zxy ( float zAngle,
float xAngle,
float yAngle )

Multiplies and accumulates XMTRX by a 3D Z-X-Y rotation matrix, with the corresponding angles given in radians.

The transform is applied to the inner 3x3 values within XMTRX, preserving the translational components.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_apply_rotation_zyx(), shz_xmtrx_apply_rotation_yxz()

◆ shz_xmtrx_apply_rotation_yxz()

void shz_xmtrx_apply_rotation_yxz ( float yAngle,
float xAngle,
float zAngle )

Multiplies and accumulates XMTRX by a 3D Y-X-Z rotation matrix, with the corresponding angles given in radians.

The transform is applied to the inner 3x3 values within XMTRX, preserving the translational components.

Note
The given angles are represented as Tait-Bryan angles, representing an extrinsic rotation.
See also
shz_xmtrx_apply_rotation_xyz(), shz_xmtrx_apply_rotation_zyx()

◆ shz_xmtrx_apply_rotation()

void shz_xmtrx_apply_rotation ( float angle,
float x,
float y,
float z )

Transforms the values of the inner 3x3 matrix by a rotation matrix of angle radians about the axis with the given components.

◆ shz_xmtrx_apply_rotation_quat()

void shz_xmtrx_apply_rotation_quat ( shz_quat_t quat)

Transforms the values of the inner 3x3 matrix by the rotation matrix represented by the given quaternion.

◆ shz_xmtrx_apply_lookat()

void shz_xmtrx_apply_lookat ( shz_vec3_t eye,
shz_vec3_t center,
shz_vec3_t up )

Applies the 3D "lookAt" matrix constructed with the given vector components onto XMTRX. Equivalent to gluLookAt().

◆ shz_xmtrx_apply_ortho()

void shz_xmtrx_apply_ortho ( float left,
float right,
float bottom,
float top,
float near,
float far )

Applies a 2D orthographic projection matrix onto XMTRX, equivalent to glOrtho().

◆ shz_xmtrx_apply_frustum()

void shz_xmtrx_apply_frustum ( float left,
float right,
float bottom,
float top,
float near,
float far )

Applies a frustum projection matrix onto XMTRX, equivalent to glFrustum().

◆ shz_xmtrx_apply_perspective()

void shz_xmtrx_apply_perspective ( float fov,
float aspect,
float near_z )

Multiplies and accumulates the perspective matrix constructed from the given values onto XMTRX.

fr[n + 0] fr[n + 4] fr[n + 8] fr[n + 12]
cot(f)/a 0.0f 0.0f 0.0f
0.0f cot(f) 0.0f 0.0f
0.0f 0.0f 0.0f nz
0.0f 0.0f -1.0f 0.0f

◆ shz_xmtrx_apply_screen()

void shz_xmtrx_apply_screen ( float width,
float height )

Multiplies and accumulates the viewport matrix created with the given components.

fr[n + 0] fr[n + 4] fr[n + 8] fr[n + 12]
w*0.5f 0.0f 0.0f w*0.5f
0.0f -h*0.5f 0.0f h*0.5f
0.0f 0.0f 1.0f 0.0f
0.0f 0.0f 0.0f 1.0f

◆ shz_xmtrx_apply_symmetric_skew()

void shz_xmtrx_apply_symmetric_skew ( float x,
float y,
float z )

Multiplies and accumulates the 3D symmetric skew matrix with the given components onto XMTRX.

◆ shz_xmtrx_apply_permutation_wxyz()

void shz_xmtrx_apply_permutation_wxyz ( void )

Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors to be in WXYZ order.

◆ shz_xmtrx_apply_permutation_yzwx()

void shz_xmtrx_apply_permutation_yzwx ( void )

Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors to be in YZWX order.

◆ shz_xmtrx_apply_self()

void shz_xmtrx_apply_self ( void )

Multiplies and accumulatse the XMTRX matrix by itself, squaring it.

◆ shz_xmtrx_translate()

void shz_xmtrx_translate ( float x,
float y,
float z )

Multiplies and accumulates XMTRX by a 3D translation matrix with the given components (glTranslatef() equivalent).

◆ shz_xmtrx_scale()

void shz_xmtrx_scale ( float x,
float y,
float z )

Multiplies and accumulates XMTRX by a 3D scaling matrix with the given components (glScalef() equivalent).

◆ shz_xmtrx_rotate_x()

void shz_xmtrx_rotate_x ( float radians)

Multiplies and accumulates XMTRX by a 3D rotation matrix about the X axis.

◆ shz_xmtrx_rotate_y()

void shz_xmtrx_rotate_y ( float radians)

Multiplies and accumulates XMTRX by a 3D rotation matrix about the Y axis.

◆ shz_xmtrx_rotate_z()

void shz_xmtrx_rotate_z ( float radians)

Multiplies and accumulates XMTRX by a 3D rotation matrix about the Z axis.

◆ shz_xmtrx_rotate_xyz()

void shz_xmtrx_rotate_xyz ( float xRadians,
float yRadians,
float zRadians )

Multiplies and accumulates XMTRX by 3D rotation matrices about the X then Y then Z axes.

◆ shz_xmtrx_rotate_zyx()

void shz_xmtrx_rotate_zyx ( float zRadians,
float yRadians,
float xRadians )

Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then Y then X axes.

◆ shz_xmtrx_rotate_zxy()

void shz_xmtrx_rotate_zxy ( float zRadians,
float xRadians,
float yRadians )

Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then X then Y axes.

◆ shz_xmtrx_rotate_yxz()

void shz_xmtrx_rotate_yxz ( float yRadians,
float xRadians,
float zRadians )

Multiplies and accumulates XMTRX by 3D rotation matrices about the Y then X then Z axes.

◆ shz_xmtrx_rotate()

void shz_xmtrx_rotate ( float radians,
float xAxis,
float yAxis,
float zAxis )

Multiplies and accumulates XMTRX by the 3D rotation matrix formed by the given axis and angle (glRotatef equivalent).

◆ shz_xmtrx_load_apply_4x4()

void shz_xmtrx_load_apply_4x4 ( const shz_mat4x4_t * matrix1,
const shz_mat4x4_t * matrix2 )

Loads XMTRX with the result of applying matrix2 onto matrix1.

This operation is equivalent to: shz_xmtrx_load_4x4(matrix1); shz_xmtrx_apply_4x4(matrix2);

However, it has been optimized and pipelined for performing the load and multiply in parallel.

See also
shz_xmtrx_load_4x4(), shz_xmtrx_apply_4x4(), shz_xmtrx_load_apply_store_4x4()

◆ shz_xmtrx_load_apply_unaligned_4x4()

void shz_xmtrx_load_apply_unaligned_4x4 ( const float matrix1[16],
const float matrix2[16] )

Loads XMTRX with the result of applying unaligned matrix2 onto matrix1.

This routine is equivalent to shz_xmtrx_load_apply_4x4(), except that the two operand matrices do not require 8-byte alignment and can simply be 16-element single-precision float arrays.

See also
shz_xmtrx_load_apply_4x4()

◆ shz_xmtrx_load_apply_store_4x4()

void shz_xmtrx_load_apply_store_4x4 ( shz_mat4x4_t * out,
const shz_mat4x4_t * matrix1,
const shz_mat4x4_t * matrix2 )

Loads XMTRX with the 4x4 result of applying matrix2 onto matrix1, storing the result.

This operation is equivalent to: shz_xmtrx_load_4x4(matrix1); shz_xmtrx_apply_4x4(matrix2); shz_xmtrx_store_4x4(out);

However, it has been optimized and pipelined for performing the loads, multiplies, and stores in parallel.

See also
shz_xmtrx_load_apply(), shz_xmtrx_load_apply_store_unaligned_4x4()

◆ shz_xmtrx_load_apply_store_unaligned_4x4()

void shz_xmtrx_load_apply_store_unaligned_4x4 ( float out[16],
const float matrix1[16],
const float matrix2[16] )

Loads XMTRX with the result of applying unaligned matrix2 onto unaligned matrix1, storing the result.

This routine is equivalent to shz_xmtrx_load_apply_store_4x4(), except that the three operand matrices do not require 8-byte alignment and can simply be 16-element single-precision float arrays.

See also
shz_xmtrx_load_apply_store_4x4()

◆ shz_xmtrx_load_apply_store_3x4()

void shz_xmtrx_load_apply_store_3x4 ( shz_mat3x4_t * out,
const shz_mat3x4_t * matrix1,
const shz_mat3x4_t * matrix2 )

Loads XMTRX with the 3x4 result of applying matrix2 onto matrix1, storing the result.

This operation is equivalent to: shz_xmtrx_load_3x4(matrix1); shz_xmtrx_apply_3x4(matrix2); shz_xmtrx_store_3x4(out);

However, it has been optimized and pipelined for performing the loads, multiplies, and stores in parallel.

Note
The resulting matrix does not get stored within XMTRX, despite it getting clobbered.
See also
shz_xmtrx_load_3x4(), shz_xmtrx_apply_3x4(), shz_xmtrx_store_3x4()

◆ shz_xmtrx_load_apply_store_3x3()

void shz_xmtrx_load_apply_store_3x3 ( shz_mat3x3_t * out,
const shz_mat3x3_t * matrix1,
const shz_mat3x3_t * matrix2 )

Loads XMTRX with the 3x3 result of applying matrix2 onto matrix1, storing the result.

This operation is equivalent to: shz_xmtrx_load_3x3(matrix1); shz_xmtrx_apply_3x3(matrix2); shz_xmtrx_store_3x3(out);

However, it has been optimized and pipelined for performing the loads, multiplies, and stores in parallel.

Note
The resulting matrix does not get stored within XMTRX, despite it getting clobbered.
See also
shz_xmtrx_load_3x3(), shz_xmtrx_apply_3x3(), shz_xmtrx_store_3x3()

◆ shz_xmtrx_transform_vec4()

shz_vec4_t shz_xmtrx_transform_vec4 ( shz_vec4_t vec)

Returns the 4D vector that is the result of transforming vec by XMTRX.

◆ shz_xmtrx_transform_vec3()

shz_vec3_t shz_xmtrx_transform_vec3 ( shz_vec3_t vec)

Returns the 3D vector that is the result of transforming vec by XMTRX.

◆ shz_xmtrx_transform_vec2()

shz_vec2_t shz_xmtrx_transform_vec2 ( shz_vec2_t vec)

Returns the 2D vector that is the result of transforming vec by XMTRX.

◆ shz_xmtrx_transform_point2()

shz_vec2_t shz_xmtrx_transform_point2 ( shz_vec2_t pt)

Returns the 2D point that is the result of transforming pt by XMTRX.

◆ shz_xmtrx_transform_point3()

shz_vec3_t shz_xmtrx_transform_point3 ( shz_vec3_t pt)

Returns the 3D point that is the result of transforming pt by XMTRX.

◆ shz_xmtrx_set_translation()

void shz_xmtrx_set_translation ( float x,
float y,
float z )

Sets only the translational components of XMTRX to the given values.

◆ shz_xmtrx_add_4x4()

void shz_xmtrx_add_4x4 ( const shz_mat4x4_t * mat)

Adds each element within mat to each element within XMTRX, storing the result in XMTRX.

◆ shz_xmtrx_sub_4x4()

void shz_xmtrx_sub_4x4 ( const shz_mat4x4_t * mat)

Subtracts each element within mat from each element within XMTRX, storing the result in XMTRX.

◆ shz_xmtrx_add_symmetric_skew()

void shz_xmtrx_add_symmetric_skew ( float x,
float y,
float z )

Adds the values of a 3D symmetric skew matrix constructed from the given components to XMTRX.

◆ shz_xmtrx_add_diagonal()

void shz_xmtrx_add_diagonal ( float x,
float y,
float z,
float w )

Adds the values of a 4D diagonal matrix constructed from the given components to XMTRX.

◆ shz_xmtrx_transpose()

void shz_xmtrx_transpose ( void )

Transposes the elements within XMTRX, in-place.

◆ shz_xmtrx_negate()

void shz_xmtrx_negate ( void )

Negates each element held within XMTRX.

◆ shz_xmtrx_abs()

void shz_xmtrx_abs ( void )

Takes the absolute value of each element held within XMTRX.

◆ shz_xmtrx_init_fft_weights()

void shz_xmtrx_init_fft_weights ( float radians)

Initializes XMTRX to the sin/cos weights used to multiply two samples within an FFT.

◆ shz_xmtrx_to_quat()

shz_quat_t shz_xmtrx_to_quat ( void )

Constructs a quaternion from the 3D rotation matrix within XMTRX.

◆ shz_xmtrx_determinant()

float shz_xmtrx_determinant ( void )

Returns the determinant of XMTRX.

◆ shz_xmtrx_invert()

void shz_xmtrx_invert ( void )

Inverts XMTRX in-place.

Stores XMTRX to memory, computes the inverse via shz_mat4x4_inverse(), and reloads the result.

Warning
This routine is out-of-line.