Class OpenXRFeature | OpenXR Plugin | 1.12.0-exp.1 (2024)

Table of Contents
Properties Methods

A Unity OpenXR Feature.This class can be inherited from to add feature specific data and logic.Feature-specific settings are serialized for access at runtime.

Inheritance

Object

ScriptableObject

OpenXRFeature

ConformanceAutomationFeature

XrPerformanceSettingsFeature

FoveatedRenderingFeature

MetaQuestFeature

MockRuntime

OculusQuestFeature

OpenXRInteractionFeature

RuntimeDebuggerOpenXRFeature

Inherited Members

ScriptableObject.SetDirty()

ScriptableObject.CreateInstance<T>()

Object.GetInstanceID()

Object.Instantiate(Object, Vector3, Quaternion)

Object.Instantiate(Object, Vector3, Quaternion, Transform)

Object.Instantiate(Object)

Object.Instantiate(Object, Transform)

Object.Instantiate<T>(T)

Object.Instantiate<T>(T, Vector3, Quaternion, Transform)

Object.Instantiate<T>(T, Transform)

Object.Destroy(Object)

Object.DestroyImmediate(Object)

Object.DontDestroyOnLoad(Object)

Object.DestroyObject(Object)

Object.FindObjectsOfType<T>()

Object.FindObjectsByType<T>(FindObjectsSortMode)

Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)

Object.FindObjectOfType<T>()

Object.FindFirstObjectByType<T>()

Object.FindAnyObjectByType<T>()

Object.FindFirstObjectByType<T>(FindObjectsInactive)

Object.FindAnyObjectByType<T>(FindObjectsInactive)

Object.ToString()

Object.name

Object.hideFlags

Namespace: UnityEngine.XR.OpenXR.Features
Assembly: Unity.XR.OpenXR.dll
Syntax
[Serializable]public abstract class OpenXRFeature : ScriptableObject

Properties

enabled

Feature is enabled and will be started when the OpenXR loader is initialized.

Note that the enabled state of a feature cannot be modified once OpenXR is initialized andcan be used at runtime to determine if a feature successfully initialized.

Declaration
public bool enabled { get; set; }
Property Value
Type Description
bool

xrGetInstanceProcAddr

Accessor for xrGetInstanceProcAddr function pointer.

Declaration
protected static IntPtr xrGetInstanceProcAddr { get; }
Property Value
Type Description
IntPtr

Methods

Awake()

Declaration
protected virtual void Awake()

CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor>, string)

Creates a subsystem based on a given a list of descriptors and a specific subsystem id.Promoted to public for extensions.

Declaration
protected void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
Parameters
Type Name Description
List<TDescriptor> descriptors

List of TDescriptor instances to use for subsystem matching

string id

The identifier key of the particular subsystem implementation being requested

Type Parameters
Name Description
TDescriptor

The descriptor type being passed in

TSubsystem

The subsystem type being requested

DestroySubsystem<T>()

Destroys a subsystem instance of a given type. Subsystem is assumed to already be loaded froma previous call to CreateSubsystem.Promoted to public for extensions.

Declaration
protected void DestroySubsystem<T>() where T : class, ISubsystem
Type Parameters
Name Description
T

A subclass of ISubsystem

GetAction(InputAction)

Returns XrAction handle bound to the given UnityEngine.InputSystem.InputAction.

Declaration
protected ulong GetAction(InputAction inputAction)
Parameters
Type Name Description
InputAction inputAction

Action to retrieve XrAction handles for

Returns
Type Description
ulong

XrAction handle bound to the given UnityEngine.InputSystem.InputAction or 0 if there is no bound XrAction

GetCurrentAppSpace()

Returns the current app space.

Declaration
protected static ulong GetCurrentAppSpace()
Returns
Type Description
ulong

Current app space

GetCurrentInteractionProfile(string)

Returns the path of the current interaction profile for the given user path.

Declaration
protected static ulong GetCurrentInteractionProfile(string userPath)
Parameters
Type Name Description
string userPath

User path

Returns
Type Description
ulong

A path to the interaction profile, or XrPath.none if the path could not be retrieved.

GetCurrentInteractionProfile(ulong)

Returns the path of the current interaction profile for the given user path.

Declaration
protected static ulong GetCurrentInteractionProfile(ulong userPath)
Parameters
Type Name Description
ulong userPath

OpenXR User Path (eg: /user/hand/left)

Returns
Type Description
ulong

A path to the interaction profile, or XrPath.none if the path could not be retrieved.

GetEnvironmentBlendMode()

Returns the current XR Environment Blend Mode.

Declaration
protected static XrEnvironmentBlendMode GetEnvironmentBlendMode()
Returns
Type Description
XrEnvironmentBlendMode

Current XR Environment Blend Mode

GetValidationChecks(List<ValidationRule>, BuildTargetGroup)

Allows a feature to add to a list of validation rules which your feature will evaluate at build time.Details of the validation results can be found in OpenXRProjectValidation.

Declaration
protected virtual void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
Parameters
Type Name Description
List<OpenXRFeature.ValidationRule> rules

Your feature will check the rules in this list at build time. Add rules that you want your feature to check, and remove rules that you want your feature to ignore.

BuildTargetGroup targetGroup

Build target group these validation rules will be evaluated for.

GetViewConfigurationTypeForRenderPass(int)

Returns viewConfigurationType for the given renderPass index.

Declaration
protected static int GetViewConfigurationTypeForRenderPass(int renderPassIndex)
Parameters
Type Name Description
int renderPassIndex

RenderPass index

Returns
Type Description
int

viewConfigurationType for certain renderPass. Return 0 if invalid renderPass.

HookGetInstanceProcAddr(IntPtr)

Called to hook xrGetInstanceProcAddr.Returning a different function pointer allows intercepting any OpenXR method.

Declaration
protected virtual IntPtr HookGetInstanceProcAddr(IntPtr func)
Parameters
Type Name Description
IntPtr func

xrGetInstanceProcAddr native function pointer

Returns
Type Description
IntPtr

Function pointer that Unity will use to look up OpenXR native functions.

OnAppSpaceChange(ulong)

Called when the reference xrSpace for the app changes.

Declaration
protected virtual void OnAppSpaceChange(ulong xrSpace)
Parameters
Type Name Description
ulong xrSpace

Handle of the xrSpace

OnDisable()

Declaration
protected virtual void OnDisable()

OnEnable()

Declaration
protected virtual void OnEnable()

OnEnabledChange()

Called when the enabled state of a feature changes

Declaration
protected virtual void OnEnabledChange()

OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)

Notification to the feature implementer that the environment blend mode has changed.

Declaration
protected virtual void OnEnvironmentBlendModeChange(XrEnvironmentBlendMode xrEnvironmentBlendMode)
Parameters
Type Name Description
XrEnvironmentBlendMode xrEnvironmentBlendMode

New environment blend mode value

OnFormFactorChange(int)

Notification to the feature implementer that the form factor has changed.

Declaration
protected virtual void OnFormFactorChange(int xrFormFactor)
Parameters
Type Name Description
int xrFormFactor

New form factor value

OnInstanceCreate(ulong)

Called after xrCreateInstance.

Declaration
protected virtual bool OnInstanceCreate(ulong xrInstance)
Parameters
Type Name Description
ulong xrInstance

Handle of the xrInstance

Returns
Type Description
bool

OnInstanceDestroy(ulong)

Called before xrDestroyInstance

Declaration
protected virtual void OnInstanceDestroy(ulong xrInstance)
Parameters
Type Name Description
ulong xrInstance

Handle of the xrInstance

OnInstanceLossPending(ulong)

Called when the OpenXR loader receives the XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING eventfrom the runtime. This is a notification to the feature implementer that the instance isabout to be lost. This feature should do what it needs to do toclean up in preparation for termination.

Declaration
protected virtual void OnInstanceLossPending(ulong xrInstance)
Parameters
Type Name Description
ulong xrInstance

The instance that is going to be lost

OnSessionBegin(ulong)

Called after xrSessionBegin.

Declaration
protected virtual void OnSessionBegin(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

Handle of the xrSession

OnSessionCreate(ulong)

Called after xrCreateSession.

Declaration
protected virtual void OnSessionCreate(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

Handle of the xrSession

OnSessionDestroy(ulong)

Called before xrDestroySession.

Declaration
protected virtual void OnSessionDestroy(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

Handle of the xrSession

OnSessionEnd(ulong)

Called before xrEndSession.

Declaration
protected virtual void OnSessionEnd(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

Handle of the xrSession

OnSessionExiting(ulong)

Called when the runtime transitions to the XR_SESSION_STATE_EXITING state.

Declaration
protected virtual void OnSessionExiting(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

Handle of the xrSession

OnSessionLossPending(ulong)

Called when the runtime transitions to the XR_SESSION_STATE_LOSS_PENDINGstate. This is a notification to the feature implementer that the session isabout to be lost. This feature should do what it needs to do toprepare for potential session recreation.

Declaration
protected virtual void OnSessionLossPending(ulong xrSession)
Parameters
Type Name Description
ulong xrSession

The session that is going to be lost

OnSessionStateChange(int, int)

Called when the OpenXR loader receives the XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED eventfrom the runtime signaling that the XrSessionState has changed.

Declaration
protected virtual void OnSessionStateChange(int oldState, int newState)
Parameters
Type Name Description
int oldState

Previous state

int newState

New state

OnSubsystemCreate()

Called after the OpenXR Loader is initialized and has created its subsystems.

Declaration
protected virtual void OnSubsystemCreate()

OnSubsystemDestroy()

Called before the OpenXR loader destroys its subsystems.

Declaration
protected virtual void OnSubsystemDestroy()

OnSubsystemStart()

Called after the OpenXR loader has started its subsystems.

Declaration
protected virtual void OnSubsystemStart()

OnSubsystemStop()

Called before the OpenXR loader stops its subsystems.

Declaration
protected virtual void OnSubsystemStop()

OnSystemChange(ulong)

Called after xrGetSystem.

Declaration
protected virtual void OnSystemChange(ulong xrSystem)
Parameters
Type Name Description
ulong xrSystem

Handle of the xrSystemId

OnViewConfigurationTypeChange(int)

Notification to the feature implementer that the view configuration type has changed.

Declaration
protected virtual void OnViewConfigurationTypeChange(int xrViewConfigurationType)
Parameters
Type Name Description
int xrViewConfigurationType

New view configuration type

PathToString(ulong)

Converts an XrPath to a string.

Declaration
protected static string PathToString(ulong path)
Parameters
Type Name Description
ulong path

Path to convert

Returns
Type Description
string

String that represents the path, or null if the path is invalid.

RegisterStatsDescriptor(string, StatFlags)

Registers an OpenXR statistic with the given name and flags.This method is not thread safe, so it should only be called at OnInstanceCreate.

Declaration
protected static ulong RegisterStatsDescriptor(string statName, OpenXRFeature.StatFlags statFlags)
Parameters
Type Name Description
string statName

String identifier for the statistic.

OpenXRFeature.StatFlags statFlags

Properties to be applied to the statistic.

Returns
Type Description
ulong

Stat Id

SetEnvironmentBlendMode(XrEnvironmentBlendMode)

Set the current XR Environment Blend Mode if it is supported by the active runtime. If not supported, fall back to the runtime preference.

Declaration
protected static void SetEnvironmentBlendMode(XrEnvironmentBlendMode xrEnvironmentBlendMode)
Parameters
Type Name Description
XrEnvironmentBlendMode xrEnvironmentBlendMode

Environment Blend Mode (e.g.: Opaque = 1, Additive = 2, AlphaBlend = 3)

SetStatAsFloat(ulong, float)

Assigns a float value to a registered statistic. Its thread safe.

Declaration
protected static void SetStatAsFloat(ulong statId, float value)
Parameters
Type Name Description
ulong statId

Identifier of the previously registered statistic.

float value

Float value to be assigned to the stat.

SetStatAsUInt(ulong, uint)

Declaration
protected static void SetStatAsUInt(ulong statId, uint value)
Parameters
Type Name Description
ulong statId
uint value

StartSubsystem<T>()

Start a subsystem instance of a given type. Subsystem is assumed to already be loaded froma previous call to CreateSubsystem.Promoted to public for extensions.

Declaration
protected void StartSubsystem<T>() where T : class, ISubsystem
Type Parameters
Name Description
T

A subclass of ISubsystem

StopSubsystem<T>()

Stops a subsystem instance of a given type. Subsystem is assumed to already be loaded froma previous call to CreateSubsystem.Promoted to public for extensions.

Declaration
protected void StopSubsystem<T>() where T : class, ISubsystem
Type Parameters
Name Description
T

A subclass of ISubsystem

StringToPath(string)

Converts a string to an XrPath.

Declaration
protected static ulong StringToPath(string str)
Parameters
Type Name Description
string str

String to convert

Returns
Type Description
ulong

Path of converted string, or XrPath.none if string could not be converted.

Class OpenXRFeature
 | OpenXR Plugin | 1.12.0-exp.1 (2024)
Top Articles
Exandria Unlimited: Calamity Premieres Thursday, May 26th! | Critical Role
Critical Role’s newest DM changes the game
Ron Martin Realty Cam
Odawa Hypixel
Phcs Medishare Provider Portal
Vaya Timeclock
DL1678 (DAL1678) Delta Historial y rastreo de vuelos - FlightAware
Craigslist Nj North Cars By Owner
30% OFF Jellycat Promo Code - September 2024 (*NEW*)
Corpse Bride Soap2Day
Oriellys St James Mn
Ssefth1203
De Leerling Watch Online
Methodist Laborworkx
Superhot Unblocked Games
United Dual Complete Providers
2024 U-Haul ® Truck Rental Review
Erskine Plus Portal
Seattle Rpz
Dc Gas Login
The Superhuman Guide to Twitter Advanced Search: 23 Hidden Ways to Use Advanced Search for Marketing and Sales
Dark Chocolate Cherry Vegan Cinnamon Rolls
NBA 2k23 MyTEAM guide: Every Trophy Case Agenda for all 30 teams
Odfl4Us Driver Login
Accuweather Mold Count
What Is Vioc On Credit Card Statement
PowerXL Smokeless Grill- Elektrische Grill - Rookloos & geurloos grillplezier - met... | bol
Atdhe Net
Dragger Games For The Brain
Miltank Gamepress
Talk To Me Showtimes Near Marcus Valley Grand Cinema
Greyson Alexander Thorn
Impact-Messung für bessere Ergebnisse « impact investing magazin
Roanoke Skipthegames Com
27 Modern Dining Room Ideas You'll Want to Try ASAP
13301 South Orange Blossom Trail
Reserve A Room Ucla
Maths Open Ref
Kltv Com Big Red Box
Pnc Bank Routing Number Cincinnati
Seymour Johnson AFB | MilitaryINSTALLATIONS
AP Microeconomics Score Calculator for 2023
D3 Boards
Carteret County Busted Paper
Shoecarnival Com Careers
Goats For Sale On Craigslist
Arch Aplin Iii Felony
Booknet.com Contract Marriage 2
Understanding & Applying Carroll's Pyramid of Corporate Social Responsibility
Sam's Club Fountain Valley Gas Prices
Rise Meadville Reviews
Wayward Carbuncle Location
Latest Posts
Article information

Author: Corie Satterfield

Last Updated:

Views: 5949

Rating: 4.1 / 5 (42 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Corie Satterfield

Birthday: 1992-08-19

Address: 850 Benjamin Bridge, Dickinsonchester, CO 68572-0542

Phone: +26813599986666

Job: Sales Manager

Hobby: Table tennis, Soapmaking, Flower arranging, amateur radio, Rock climbing, scrapbook, Horseback riding

Introduction: My name is Corie Satterfield, I am a fancy, perfect, spotless, quaint, fantastic, funny, lucky person who loves writing and wants to share my knowledge and understanding with you.