# shz_mat4x4_t

Source: https://sh4zam.com/api/matrix/shz_mat4x4_t/

```c
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.

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `elem` | `float[16]` | \< Inner convenience union. |
| `elem2D` | `float[4][4]` | Access the matrix as a 2D array of 4x4 single-precision floats. |
| `col` | `shz_vec4_t[4]` | Access the matrix as an array of 4 1x4 column vectors. |
| `left` | `shz_vec4_t` | \< Named column vectors. |
| `up` | `shz_vec4_t` | Access the second column of the matrix as a 1x4 vector. |
| `forward` | `shz_vec4_t` | Access the third column of the matrix as a 1x4 vector. |
| `pos` | `shz_vec4_t` | Access the last column of the matrix as a 1x4 vector. |

## Warnings

- This structure MUST be aligned on 8-byte boundaries!

## Availability

- **C++ equivalent:** [`shz::mat4x4`](https://sh4zam.com/api/cpp/mat4x4/)
- **Back-ends:** n/a (not a function)
- **Defined in:** [`sh4zam/shz_matrix.h:65`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_matrix.h#L65)
- **Module:** [Matrix](https://sh4zam.com/api/matrix/), section "Types"
