The osgXR API is currently considered unstable, however it is versioned. Only matching minor version numbers should be expected to be source and binary compatible with one another.
The osgXR headers can be found in include/osgXR/.
The initial version of this library exposed <osgXR/OpenXRDisplay> for
configuring a view for VR, and <osgXR/osgXR> with a convenience wrapper
osgXR::setupViewerDefaults to set up VR automatically based on environment
variables. This worked for most simple OpenSceneGraph examples, however for real
projects something more capable is needed, so it is likely these will be removed
in a future version.
It is instead recommended to extend the osgXR::Manager class from
<osgXR/Manager> and implement the callbacks.
This header provides the osgXR::Action base class, and the
osgXR::ActionBoolean, osgXR::ActionFloat, osgXR::ActionVector2f,
osgXR::ActionPose and osgXR::ActionVibration classes which an
application can use to define OpenXR actions, read input state, and send haptic
output.
This header provides the osgXR::ActionSet class which an application uses
to group actions into groups which can be separately activated and deactivated.
This header provides the osgXR::Condition base class, along with other
classes representing conditions that may need evaluating at setup time, such as
extensions and API version.
This header provides the osgXR::CompositionLayer base class, from which
other composition layer classes are derived. It provides generic composition
layer capabilities such as visibility, ordering, and alpha blending modes.
This header provides the osgXR::CompositionLayerQuad class which an
application can use to control an OpenXR runtime composited quad in the VR
space.
This header provides the osgXR::Extension class which an application can
use to find out about specific OpenXR extensions supported by the OpenXR
runtime. Extensions can be enabled, for the purposes of extending interaction
profiles.
This header provides the osgXR::InteractionProfile class which an
application uses to suggest bindings between OpenXR actions and the physical
interactions of a given OpenXR controller profile.
This header provides the osgXR::Manager class which an application can
extend to implement a VR manager class. Virtual callbacks tell the application
which camera views are required to implement VR, and an update() function
gives osgXR a chance to incrementally bring up or tear down VR.
This header provides the osgXR::Mirror class which an application can use to
register a desktop mirror of the VR view.
This header provides the osgXR::MirrorSettings class which encapsulates
configuration data for desktop mirrors of VR views.
This header provides the osgXR::OpenXRDisplay ViewConfig class. It is
largely replaced by osgXR::Manager.
This header provides the osgXR::Pose class which represents the position
and orientation of an object or space, along with flags to indicate whether the
position and orientation are valid and currently being tracked.
This header provides the osgXR::Settings class which encapsulates all the VR
configuration data.
This header provides the osgXR::Subaction class which an application can
use to represent OpenXR subaction paths (top level user paths), which allow a
single OpenXR action to represent the same action on both hands. It can be
passed to other action related classes to filter actions by hand, and it can be
extended by the application to implement a callback for InteractionProfile
changes.
This header provides the simple osgXR::SubImage class which wraps a
osgXR::Swapchain smart pointer and describes a rectangular area within each
swapchain image. An application can optionally use this to specify what sub-part
of a swapchain image should be rendered by a CompositionLayer.
This header provides the osgXR::Swapchain class which represents a chain of
images which are passed to the OpenXR runtime. These can be attached to a camera
to allow it to be rendered into, and also attached to a mirror object to allow
the resulting texture (which switches every frame) to be used for further
rendering.
This header provides the osgXR::Version helper class which represents a
version number similar to XrVersion, used for OpenXR runtime and API
versions.
This header provides the osgXR::View class which represents a view of the
world which osgXR::Manager will request to be configured by the application.
This header provides convenience functions for quick and easy integration of VR
capabilities into a simple OpenSceneGraph application or example. It is
recommended osgXR::Manager be used instead for most projects.
This sets up VR on the provided viewer based on the content of the following environment variables:
OSGXR=1enables VR.OSGXR_MODE=SLAVE_CAMERASforces the use of separate slave cameras per view.OSGXR_MODE=SCENE_VIEWforces the use of OpenSceneGraph's SceneView stereo (default).OSGXR_SWAPCHAIN=MULTIPLEforces the use of separate swapchains per view.OSGXR_SWAPCHAIN=SINGLEforces the use of a single swapchain containing all views.OSGXR_UNITS_PER_METER=10allows the scale of the environment to be controlled.OSGXR_VALIDATION_LAYER=1enables the OpenXR validation layer (off by default).OSGXR_DEPTH_INFO=1enables passing of depth information to OpenXR (off by default).OSGXR_MIRROR=NONEuse a blank screen as the default mirror.OSGXR_MIRROR=LEFTuse OpenXR view 0 (left) as the default mirror.OSGXR_MIRROR=RIGHTuse OpenXR view 1 (right) as the default mirror.OSGXR_MIRROR=LEFT_RIGHTuse both left and right views side by side as the default mirror.