# XRBodyTrackingFeature

This `OpenXRInteractionFeature` configures Android XR extensions `XR_ANDROIDX_body_tracking` at runtime and provides `XRHumanBodySubsystem` implementation that works on Android XR platform.

Note: due to the dependency on `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRSessionFeature#classGoogle_1_1XR_1_1Extensions_1_1XRSessionFeature`, its priority must be lower than the features so the feature registration happens after `XrInstanceManager` creation.

## Summary

### Inheritance

Inherits from: `OpenXRFeature`, [`Google.XR.Extensions.IXRSpatialSdk`](https://developer.android.com/develop/xr/unity/reference/interface/Google/XR/Extensions/IXRSpatialSdk)

| ### Public attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#extensionstring = "XR_ANDROIDX1_body_tracking"` | `const string` The OpenXR Extension string. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#featureid = "com.google.xr.extensions.body_tracking"` | `const string` The feature ID string. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#requestedjointset => _jointSet` | `https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#xrbodyjointset` Gets the requested joint set to be tracked at runtime. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#uiname = "Android XR (Extensions): Human Body (Experimental*)"` | `const string` The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes. |

| ### Public static attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#isextensionenabled => _extensionEnabled` | `bool` Gets if the required OpenXR extension is enabled. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#requiredpermission = AndroidXRPermission.BodyTracking` | `readonly https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#androidxrpermission` Runtime permission required to enable body tracking. |

| ### Properties ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#autocalibration` | `bool` Gets or sets a value indicating whether to use automatic calibration at runtime. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#humanbodyproportions` | `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRHumanBodyProportions#classGoogle_1_1XR_1_1Extensions_1_1XRHumanBodyProportions` Gets or sets the [XRHumanBodyProportions](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRHumanBodyProportions#classGoogle_1_1XR_1_1Extensions_1_1XRHumanBodyProportions) for rest pose skeleton computation. |

| ### Public functions ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#gettargetversion()` | `https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#xrspatialsdkversions` Gets the target version of the given feature if applicable. |

## Public attributes

### ExtensionString

```c#
const string ExtensionString = "XR_ANDROIDX1_body_tracking"
```
The OpenXR Extension string.

Used to check if this extensions is available or enabled.

### FeatureId

```c#
const string FeatureId = "com.google.xr.extensions.body_tracking"
```
The feature ID string.

### RequestedJointSet

```c#
XRBodyJointSet RequestedJointSet => _jointSet
```
Gets the requested joint set to be tracked at runtime.

### UiName

```c#
const string UiName = "Android XR (Extensions): Human Body (Experimental*)"
```
The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.

## Public static attributes

### IsExtensionEnabled

```c#
bool IsExtensionEnabled => _extensionEnabled
```
Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns `null`. Otherwise, it indicates whether the XR_ANDROIDX_body_tracking extension is available on current device.

### RequiredPermission

```c#
readonly AndroidXRPermission RequiredPermission =
            AndroidXRPermission.BodyTracking
```
Runtime permission required to enable body tracking.

## Properties

### AutoCalibration

```c#
bool AutoCalibration
```
Gets or sets a value indicating whether to use automatic calibration at runtime.

When automatic calibration is disabled, [HumanBodyProportions](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#humanbodyproportions) will take effect.

### HumanBodyProportions

```c#
XRHumanBodyProportions HumanBodyProportions
```
Gets or sets the [XRHumanBodyProportions](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRHumanBodyProportions#classGoogle_1_1XR_1_1Extensions_1_1XRHumanBodyProportions) for rest pose skeleton computation.

It only takes effect when [AutoCalibration](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBodyTrackingFeature#autocalibration) is disabled.

## Public functions

### GetTargetVersion

```c#
XRSpatialSdkVersions GetTargetVersion()
```
Gets the target version of the given feature if applicable.