Class OpenXRSettings
Build time settings for OpenXR. These are serialized and available at runtime.
Inherited Members
Namespace: UnityEngine.XR.OpenXR
Assembly: solution.dll
Syntax
[Serializable]
public class OpenXRSettings : ScriptableObject
Properties
ActiveBuildTargetInstance
Accessor to OpenXR build time settings.
In the Unity Editor, this returns the settings for the active build target group.
Declaration
public static OpenXRSettings ActiveBuildTargetInstance { get; }
Property Value
Type | Description |
---|---|
OpenXRSettings |
AllowRecentering
Returns the current state of the recentering feature.
Declaration
public static bool AllowRecentering { get; }
Property Value
Type | Description |
---|---|
bool |
FloorOffset
Returns the current floor offset value used when approximating the floor-based position when recentering the space.
Declaration
public static float FloorOffset { get; }
Property Value
Type | Description |
---|---|
float |
Instance
Accessor to OpenXR build time settings.
In the Unity Editor, this returns the settings for the Standalone build target group.
Declaration
public static OpenXRSettings Instance { get; }
Property Value
Type | Description |
---|---|
OpenXRSettings |
depthSubmissionMode
Enables XR_KHR_composition_layer_depth if possible and resolves or submits depth to OpenXR runtime.
Declaration
public OpenXRSettings.DepthSubmissionMode depthSubmissionMode { get; set; }
Property Value
Type | Description |
---|---|
OpenXRSettings.DepthSubmissionMode |
featureCount
Number of available features.
Declaration
public int featureCount { get; }
Property Value
Type | Description |
---|---|
int |
optimizeBufferDiscards
Optimization that allows 4x MSAA textures to be memoryless on Vulkan
Declaration
public bool optimizeBufferDiscards { get; set; }
Property Value
Type | Description |
---|---|
bool |
renderMode
Runtime Stereo rendering mode.
Declaration
public OpenXRSettings.RenderMode renderMode { get; set; }
Property Value
Type | Description |
---|---|
OpenXRSettings.RenderMode |
symmetricProjection
If enabled, when the application begins it will create a stereo symmetric view that has the eye buffer resolution change based on the IPD. Provides a performance benefit across all IPDs.
Declaration
public bool symmetricProjection { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetFeature(Type)
Returns the first feature that matches the given type.
Declaration
public OpenXRFeature GetFeature(Type featureType)
Parameters
Type | Name | Description |
---|---|---|
Type | featureType | Type of the feature to return |
Returns
Type | Description |
---|---|
OpenXRFeature | Feature by type |
GetFeature<TFeature>()
Returns the first feature that matches the given type.
Declaration
public TFeature GetFeature<TFeature>() where TFeature : OpenXRFeature
Returns
Type | Description |
---|---|
TFeature | Feature by type |
Type Parameters
Name | Description |
---|---|
TFeature | Type of the feature to retrieve |
GetFeatures()
Return all features.
Declaration
public OpenXRFeature[] GetFeatures()
Returns
Type | Description |
---|---|
OpenXRFeature[] | All features |
GetFeatures(List<OpenXRFeature>)
Return all features.
Declaration
public int GetFeatures(List<OpenXRFeature> featuresOut)
Parameters
Type | Name | Description |
---|---|---|
List<OpenXRFeature> | featuresOut | Output list of features |
Returns
Type | Description |
---|---|
int | Number of features returned |
GetFeatures(Type)
Returns all features of Type.
Declaration
public OpenXRFeature[] GetFeatures(Type featureType)
Parameters
Type | Name | Description |
---|---|---|
Type | featureType | Type of the feature to retrieve |
Returns
Type | Description |
---|---|
OpenXRFeature[] | All components of Type |
GetFeatures(Type, List<OpenXRFeature>)
Returns all features of a given type.
Declaration
public int GetFeatures(Type featureType, List<OpenXRFeature> featuresOut)
Parameters
Type | Name | Description |
---|---|---|
Type | featureType | Type of the feature to retrieve |
List<OpenXRFeature> | featuresOut | Output list of features |
Returns
Type | Description |
---|---|
int | Number of features returned |
GetFeatures<TFeature>()
Returns all features of a given type.
Declaration
public OpenXRFeature[] GetFeatures<TFeature>()
Returns
Type | Description |
---|---|
OpenXRFeature[] | All components of Type |
Type Parameters
Name | Description |
---|---|
TFeature | Type of the feature to retrieve |
GetFeatures<TFeature>(List<TFeature>)
Returns all features of a given type.
Declaration
public int GetFeatures<TFeature>(List<TFeature> featuresOut) where TFeature : OpenXRFeature
Parameters
Type | Name | Description |
---|---|---|
List<TFeature> | featuresOut | Output list of features |
Returns
Type | Description |
---|---|
int | Number of features returned |
Type Parameters
Name | Description |
---|---|
TFeature | Feature type |
SetAllowRecentering(bool, float)
Activates reference space recentering when using floor-based tracking origin.
Declaration
public static void SetAllowRecentering(bool allowRecentering, float floorOffset = 1.5)
Parameters
Type | Name | Description |
---|---|---|
bool | allowRecentering | Boolean value that activates the recentering feature. |
float | floorOffset | Estimated height used when approximating the floor-based position when recentering the space. By default, this value is 1.5f |
Remarks
When a recentering event is performed, OpenXR will attempt to recenter the world space origin based on the local-floor reference space, if supported by the platform's hardware.
If that reference space isn't supported, OpenXR will then attempt to approximate it using stage space or local space.
Calling this method won't trigger a recenter event. This event will be sent from the platform's runtime.