Skip to content

shz_mat4x4_t

Markdown
typedef SHZ_ALIGNAS(8) struct shz_mat4x4 {
union { //!< Inner convenience union.
float elem[16]; //!< Access the matrix as a 1D array of 16 single-precision floats.
float elem2D[4][4]; //!< Access the matrix as a 2D array of 4x4 single-precision floats.
shz_vec4_t col[4]; //!< Access the matrix as an array of 4 1x4 column vectors.
struct { //!< Named column vectors.
shz_vec4_t left; //!< Access the first column of the matrix as a 1x4 vector.
shz_vec4_t up; //!< Access the second column of the matrix as a 1x4 vector.
shz_vec4_t forward; //!< Access the third column of the matrix as a 1x4 vector.
shz_vec4_t pos; //!< Access the last column of the matrix as a 1x4 vector.
};
};
} shz_mat4x4_t;

Structure representing a 4x4 column-major matrix.

FieldTypeDescription
elemfloat[16]< Inner convenience union.
elem2Dfloat[4][4]Access the matrix as a 2D array of 4x4 single-precision floats.
colshz_vec4_t[4]Access the matrix as an array of 4 1x4 column vectors.
leftshz_vec4_t< Named column vectors.
upshz_vec4_tAccess the second column of the matrix as a 1x4 vector.
forwardshz_vec4_tAccess the third column of the matrix as a 1x4 vector.
posshz_vec4_tAccess the last column of the matrix as a 1x4 vector.
  • This structure MUST be aligned on 8-byte boundaries!