# shz_mat4x4_billboard_y

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

> Multiplies and accumulates mat by the rotation about the Y axis that turns local +Z toward eye, as seen from pos

```c
SHZ_INLINE void shz_mat4x4_billboard_y(shz_mat4x4_t* mat, shz_vec3_t pos, shz_vec3_t eye) SHZ_NOEXCEPT;
```

Multiplies and accumulates `mat` by the rotation about the Y axis that turns local +Z toward `eye`, as seen from `pos`.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `mat` | `shz_mat4x4_t *` | The matrix to accumulate into. |
| `pos` | `shz_vec3_t` | Position of the billboarded object, used only to compute the direction to `eye`. |
| `eye` | `shz_vec3_t` | Position to face, such as the camera eye, in the same space as `pos`. |

## Returns

Nothing (`void`).

## Notes

- If `eye` lies on the Y axis through `pos`, the facing direction is undefined and no rotation is applied.

## Warnings

- This routine clobbers XMTRX.

## Naming and requirements

- `shz_mat4x4_t` and `shz_mat2x2_t` arguments must be 8-byte aligned. Unaligned data goes through the `float[16]` parameters of the `_unaligned` routines.

## Availability

- **C++ equivalent:** [`shz::mat4x4::billboard_y`](https://sh4zam.com/api/cpp/mat4x4/#billboard_y)
- **Type-generic form:** none
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_matrix.h:735`](https://github.com/gyrovorbis/sh4zam/blob/6b22b851ad9ca109049f956dbbbecf7c519c959f/include/sh4zam/shz_matrix.h#L735)
- **Module:** [Matrix](https://sh4zam.com/api/matrix/), section "GL Transformations"

## See also

[`shz_xmtrx_billboard_y`](https://sh4zam.com/api/xmtrx/shz_xmtrx_billboard_y/), [`shz_mat4x4_init_billboard_y`](https://sh4zam.com/api/matrix/shz_mat4x4_init_billboard_y/)
