# shz_quat_store_wxyz

Source: https://sh4zam.com/api/quat/shz_quat_store_wxyz/

> Stores a shz_quat_t into a layout-compatible chunk of memory in WXYZ order

```c
SHZ_INLINE void shz_quat_store_wxyz(shz_quat_t quat, void* data) SHZ_NOEXCEPT;
```

Stores a [`shz_quat_t`](https://sh4zam.com/api/quat/shz_quat_t/) into a layout-compatible chunk of memory in WXYZ order.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `quat` | `shz_quat_t` | [`shz_quat_t`](https://sh4zam.com/api/quat/shz_quat_t/) type to store into `data`. |
| `data` | `void *` | Memory chunk to store `quat` into. |

## Returns

Nothing (`void`).

## Notes

- This is a zero-overhead conversion, typically.

## Warnings

- `data` must 4-byte aligned!

## Naming and requirements

- `_wxyz`: Register/column permutation so that `FTRV` yields W first (cycle 4 instead of 7), which helps perspective division. ([Naming and Suffixes](https://sh4zam.com/concepts/naming-and-suffixes/))

## Availability

- **C++ equivalent:** [`shz::quat::store_wxyz`](https://sh4zam.com/api/cpp/quat/#store_wxyz)
- **Type-generic form:** none
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_quat.h:476`](https://github.com/gyrovorbis/sh4zam/blob/6b22b851ad9ca109049f956dbbbecf7c519c959f/include/sh4zam/shz_quat.h#L476)
- **Module:** [Quaternion](https://sh4zam.com/api/quat/), section "Adapters"

## See also

[`shz_quat_load_wxyz`](https://sh4zam.com/api/quat/shz_quat_load_wxyz/), [`shz_quat_store_xyzw`](https://sh4zam.com/api/quat/shz_quat_store_xyzw/)
