Class SpaceWarpFeature
This OpenXRFeature enables the use of SpaceWarp in OpenXR without the need for other 3rd party packages.
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features
Assembly: Unity.XR.OpenXR.dll
Syntax
public class SpaceWarpFeature : OpenXRFeature
Fields
k_OpenXRRequestedExtensions
The required OpenXR extension.
Declaration
public const string k_OpenXRRequestedExtensions = "XR_FB_space_warp"
Field Value
| Type | Description |
|---|---|
| string |
k_SpaceWarpFeatureId
The feature ID string. This is used to give the feature a well known ID for reference.
Declaration
public const string k_SpaceWarpFeatureId = "com.unity.openxr.feature.spacewarp"
Field Value
| Type | Description |
|---|---|
| string |
k_UiName
The UI name that shows on the XR Plug-in Management panel.
Declaration
public const string k_UiName = "Application SpaceWarp"
Field Value
| Type | Description |
|---|---|
| string |
Methods
OnInstanceCreate(ulong)
Called after xrCreateInstance. Override this method to validate that any necessary OpenXR extensions were
successfully enabled (OpenXRRuntime.IsExtensionEnabled)
and that any required system properties are supported. If this method returns false,
the feature's enabled property is set to false.
Declaration
protected override bool OnInstanceCreate(ulong xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance | Handle of the native |
Returns
| Type | Description |
|---|---|
| bool | true if this feature successfully initialized. Otherwise, false. |
Overrides
Remarks
If this feature is a required feature of an enabled feature set, returning false here
causes the OpenXRLoader to fail, and XR Plug-in Management will fall back to another loader if enabled.
See Also
SetAppSpacePosition(Vector3)
Update SpaceWarp with the camera's position.
Declaration
public static bool SetAppSpacePosition(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | Camera's position as a Vector3. |
Returns
| Type | Description |
|---|---|
| bool | Always returns true. |
Remarks
Depending on the headset, SpaceWarp may not need to be updated with the main camera’s position. Refer to the headset’s specifications to determine if it’s required.
SetAppSpaceRotation(Quaternion)
Update SpaceWarp with the camera's rotation.
Declaration
public static bool SetAppSpaceRotation(Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Quaternion | rotation | Camera's rotation as a Quaternion. |
Returns
| Type | Description |
|---|---|
| bool | Always returns true. |
Remarks
Depending on the headset, SpaceWarp may not need to be updated with the main camera’s rotation. Refer to the headset’s specifications to determine if it’s required.
SetSpaceWarp(bool)
Enable or disable SpaceWarp.
Declaration
public static bool SetSpaceWarp(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | The flag to enable or disable SpaceWarp. |
Returns
| Type | Description |
|---|---|
| bool | Always returns true. |