| 1 | osgXR API Documentation |
| 2 | ======================= |
| 3 | |
| 4 | The osgXR API is currently considered unstable, however it is versioned. Only |
| 5 | matching minor version numbers should be expected to be source and binary |
| 6 | compatible with one another. |
| 7 | |
| 8 | The osgXR headers can be found in [include/osgXR/](../include/osgXR/). |
| 9 | |
| 10 | The initial version of this library exposed ``<osgXR/OpenXRDisplay>`` for |
| 11 | configuring a view for VR, and ``<osgXR/osgXR>`` with a convenience wrapper |
| 12 | ``osgXR::setupViewerDefaults`` to set up VR automatically based on environment |
| 13 | variables. This worked for most simple OpenSceneGraph examples, however for real |
| 14 | projects something more capable is needed, so it is likely these will be removed |
| 15 | in a future version (they are not currently working due to the new |
| 16 | ``XRState::update()`` based state machine). |
| 17 | |
| 18 | It is instead recommended to extend the ``osgXR::Manager`` class from |
| 19 | ``<osgXR/Manager>`` and implement the callbacks. |
| 20 | |
| 21 | ## <[osgXR/Action](../include/osgXR/Action)> |
| 22 | |
| 23 | This header provides the ``osgXR::Action`` base class, and the |
| 24 | ``osgXR::ActionBoolean``, ``osgXR::ActionFloat``, ``osgXR::ActionVector2f``, |
| 25 | ``osgXR::ActionPose`` and ``osgXR::ActionVibration`` classes which an |
| 26 | application can use to define OpenXR actions, read input state, and send haptic |
| 27 | output. |
| 28 | |
| 29 | ## <[osgXR/ActionSet](../include/osgXR/ActionSet)> |
| 30 | |
| 31 | This header provides the ``osgXR::ActionSet`` class which an application uses |
| 32 | to group actions into groups which can be separately activated and deactivated. |
| 33 | |
| 34 | ## <[osgXR/CompositionLayer](../include/osgXR/CompositionLayer)> |
| 35 | |
| 36 | This header provides the ``osgXR::CompositionLayer`` base class, from which |
| 37 | other composition layer classes are derived. It provides generic composition |
| 38 | layer capabilities such as visibility, ordering, and alpha blending modes. |
| 39 | |
| 40 | ## <[osgXR/CompositionLayerQuad](../include/osgXR/CompositionLayerQuad)> |
| 41 | |
| 42 | This header provides the ``osgXR::CompositionLayerQuad`` class which an |
| 43 | application can use to control an OpenXR runtime composited quad in the VR |
| 44 | space. |
| 45 | |
| 46 | ## <[osgXR/InteractionProfile](../include/osgXR/InteractionProfile)> |
| 47 | |
| 48 | This header provides the ``osgXR::InteractionProfile`` class which an |
| 49 | application uses to suggest bindings between OpenXR actions and the physical |
| 50 | interactions of a given OpenXR controller profile. |
| 51 | |
| 52 | ## <[osgXR/Manager](../include/osgXR/Manager)> |
| 53 | |
| 54 | This header provides the ``osgXR::Manager`` class which an application can |
| 55 | extend to implement a VR manager class. Virtual callbacks tell the application |
| 56 | which camera views are required to implement VR, and an ``update()`` function |
| 57 | gives osgXR a chance to incrementally bring up or tear down VR. |
| 58 | |
| 59 | ## <[osgXR/Mirror](../include/osgXR/Mirror)> |
| 60 | |
| 61 | This header provides the ``osgXR::Mirror`` class which an application can use to |
| 62 | register a desktop mirror of the VR view. |
| 63 | |
| 64 | ## <[osgXR/MirrorSettings](../include/osgXR/MirrorSettings)> |
| 65 | |
| 66 | This header provides the ``osgXR::MirrorSettings`` class which encapsulates |
| 67 | configuration data for desktop mirrors of VR views. |
| 68 | |
| 69 | ## <[osgXR/OpenXRDisplay](../include/osgXR/OpenXRDisplay)> |
| 70 | |
| 71 | This header provides the ``osgXR::OpenXRDisplay`` ViewConfig class. It is |
| 72 | largely replaced by ``osgXR::Manager``. |
| 73 | |
| 74 | ## <[osgXR/Settings](../include/osgXR/Settings)> |
| 75 | |
| 76 | This header provides the ``osgXR::Settings`` class which encapsulates all the VR |
| 77 | configuration data. |
| 78 | |
| 79 | ## <[osgXR/Subaction](../include/osgXR/Subaction)> |
| 80 | |
| 81 | This header provides the ``osgXR::Subaction`` class which an application can |
| 82 | use to represent OpenXR subaction paths (top level user paths), which allow a |
| 83 | single OpenXR action to represent the same action on both hands. It can be |
| 84 | passed to other action related classes to filter actions by hand, and it can be |
| 85 | extended by the application to implement a callback for InteractionProfile |
| 86 | changes. |
| 87 | |
| 88 | ## <[osgXR/SubImage](../include/osgXR/SubImage)> |
| 89 | |
| 90 | This header provides the simple ``osgXR::SubImage`` class which wraps a |
| 91 | ``osgXR::Swapchain`` smart pointer and describes a rectangular area within each |
| 92 | swapchain image. An application can optionally use this to specify what sub-part |
| 93 | of a swapchain image should be rendered by a CompositionLayer. |
| 94 | |
| 95 | ## <[osgXR/Swapchain](../include/osgXR/Swapchain)> |
| 96 | |
| 97 | This header provides the ``osgXR::Swapchain`` class which represents a chain of |
| 98 | images which are passed to the OpenXR runtime. These can be attached to a camera |
| 99 | to allow it to be rendered into, and also attached to a mirror object to allow |
| 100 | the resulting texture (which switches every frame) to be used for further |
| 101 | rendering. |
| 102 | |
| 103 | ## <[osgXR/View](../include/osgXR/View)> |
| 104 | |
| 105 | This header provides the ``osgXR::View`` class which represents a view of the |
| 106 | world which ``osgXR::Manager`` will request to be configured by the application. |
| 107 | |
| 108 | ## <[osgXR/osgXR](../include/osgXR/osgXR)> |
| 109 | |
| 110 | This header provides convenience functions for quick and easy integration of VR |
| 111 | capabilities into a simple OpenSceneGraph application or example. It is |
| 112 | recommended ``osgXR::Manager`` be used instead for most projects. |
| 113 | |
| 114 | ### osgXR::setupViewerDefaults() |
| 115 | |
| 116 | This sets up VR on the provided viewer based on the content of the following |
| 117 | environment variables: |
| 118 | * ``OSGXR=1`` enables VR. |
| 119 | * ``OSGXR_MODE=SLAVE_CAMERAS`` forces the use of separate slave cameras per view. |
| 120 | * ``OSGXR_MODE=SCENE_VIEW`` forces the use of OpenSceneGraph's SceneView stereo (default). |
| 121 | * ``OSGXR_SWAPCHAIN=MULTIPLE`` forces the use of separate swapchains per view. |
| 122 | * ``OSGXR_SWAPCHAIN=SINGLE`` forces the use of a single swapchain containing all views. |
| 123 | * ``OSGXR_UNITS_PER_METER=10`` allows the scale of the environment to be controlled. |
| 124 | * ``OSGXR_VALIDATION_LAYER=1`` enables the OpenXR validation layer (off by default). |
| 125 | * ``OSGXR_DEPTH_INFO=1`` enables passing of depth information to OpenXR (off by default). |
| 126 | * ``OSGXR_MIRROR=NONE`` use a blank screen as the default mirror. |
| 127 | * ``OSGXR_MIRROR=LEFT`` use OpenXR view 0 (left) as the default mirror. |
| 128 | * ``OSGXR_MIRROR=RIGHT`` use OpenXR view 1 (right) as the default mirror. |
| 129 | * ``OSGXR_MIRROR=LEFT_RIGHT`` use both left and right views side by side as the default mirror. |