# ArPose

Represents an immutable rigid transformation from one coordinate space to another.

## Summary

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-pose#arpose` | typedef `struct ArPose_` A structured rigid transformation ([value type](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)). |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_create(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const float *pose_raw, https://developers.google.com/ar/reference/c/group/ar-pose#arpose **out_pose)` | `void` Allocates and initializes a new pose object. |
| `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_destroy(https://developers.google.com/ar/reference/c/group/ar-pose#arpose *pose)` | `void` Releases memory used by a pose object. |
| `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_getmatrix(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-pose#arpose *pose, float *out_matrix_col_major_4x4)` | `void` Converts a pose into a 4x4 transformation matrix. |
| `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_getposeraw(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-pose#arpose *pose, float *out_pose_raw_7)` | `void` Extracts the quaternion rotation and translation from a pose object. |

## Typedefs

### ArPose

```
struct ArPose_ ArPose
```
A structured rigid transformation ([value type](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).


- Allocate with: `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_create`
- Release with: `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_destroy`

<br />

## Functions

### ArPose_create

```
void ArPose_create(
  const ArSession *session,
  const float *pose_raw,
  ArPose **out_pose
)
```
Allocates and initializes a new pose object.

`pose_raw` points to an array of 7 floats, describing the rotation (quaternion) and translation of the pose in the same order as the first 7 elements of the Android `Sensor.TYPE_POSE_6DOF` values documented on [`SensorEvent.values()`](https://developer.android.com/reference/android/hardware/SensorEvent#values).

The order of the values is: qx, qy, qz, qw, tx, ty, tz.

If `pose_raw` is `NULL`, initializes with the identity pose.

### ArPose_destroy

```
void ArPose_destroy(
  ArPose *pose
)
```
Releases memory used by a pose object.

### ArPose_getMatrix

```
void ArPose_getMatrix(
  const ArSession *session,
  const ArPose *pose,
  float *out_matrix_col_major_4x4
)
```
Converts a pose into a 4x4 transformation matrix.


Details Parameters `session` The ARCore session `pose` The pose to convert `out_matrix_col_major_4x4` Pointer to an array of 16 floats, to be filled with a column-major homogenous transformation matrix, as used by OpenGL.

### ArPose_getPoseRaw

```
void ArPose_getPoseRaw(
  const ArSession *session,
  const ArPose *pose,
  float *out_pose_raw_7
)
```
Extracts the quaternion rotation and translation from a pose object.


Details Parameters `session` The ARCore session `pose` The pose to extract `out_pose_raw_7` Pointer to an array of 7 floats, to be filled with the quaternion rotation and translation as described in `https://developers.google.com/ar/reference/c/group/ar-pose#arpose_create`.