Unigine::VR Class
Header: | #include <UnigineVR.h> |
The base class for managing virtual reality in UNIGINE.
VR Initialization#
By default, VR is not initialized. To run the engine with VR, you need to specify the -vr_app command-line option on the application start-up.
Supported Graphics APIs#
The following graphics APIs are supported out of the box:
- DirectX 11
- DirectX 12
- Vulkan
For OpenGL API support, use the corresponding VR plugins (deprecated).
VR Class
Enums
API#
Name | Description |
---|---|
API_NULL = 0 | VR API is not initialized. |
API_VARJO = 1 | Varjo API. |
API_OPENVR = 2 | OpenVR API. |
API_OPENXR = 3 | OpenXR API. |
VIEWPORT_TYPE#
Name | Description |
---|---|
VIEWPORT_TYPE_CONTEXT = 0 | Context (low-res) viewport. |
VIEWPORT_TYPE_FOCUS = 1 | Focus (high-res) viewport. |
VIEWPORT_TYPE_NUM = 2 | Number of viewport types. |
EYE_TYPE#
Name | Description |
---|---|
EYE_TYPE_LEFT = 0 | Left eye. |
EYE_TYPE_RIGHT = 1 | Right eye. |
EYE_TYPE_NUM = 2 | Number of eye types. |
MIRROR_MODE#
WINDOW_MODE#
TRACKING_SPACE#
DEBUG_MODE#
RUNTIME_TYPE#
Members
void setRenderEnabled ( bool enabled = 0 ) #
Console: vr_render_enabled
Sets a new value indicating if rendering into the head-mounted display is enabled. This parameter is stored in the following configuration file: *.boot .
Arguments
- bool enabled - Set true to enable rendering into the HMD; false - to disable it. The default value is false.
bool isRenderEnabled() const#
Console: vr_render_enabled
Returns the current value indicating if rendering into the head-mounted display is enabled. This parameter is stored in the following configuration file: *.boot .
Return value
true if rendering into the HMD is enabled; otherwise false. The default value is false.void setPeripheralRenderingModeEnabled ( bool enabled = 0 ) #
Console: vr_peripheral_rendering_mode_enabled
Sets a new value indicating if the peripheral rendering mode is enabled. In this mode, the HMD has two context (peripheral) and two focus displays. You can disable two additional viewports to improve peformance.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Arguments
- bool enabled - Set true to enable the peripheral rendering mode; false - to disable it. The default value is false.
bool isPeripheralRenderingModeEnabled() const#
Console: vr_peripheral_rendering_mode_enabled
Returns the current value indicating if the peripheral rendering mode is enabled. In this mode, the HMD has two context (peripheral) and two focus displays. You can disable two additional viewports to improve peformance.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Return value
true if the peripheral rendering mode is enabled; otherwise false. The default value is false.void setMirrorMode ( VR::MIRROR_MODE mode = 3 ) #
Console: vr_mirror_mode
Sets a new mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window. This parameter is stored in the following configuration file: *.boot .
Arguments
- VR::MIRROR_MODE mode - The mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window. One of the following values:
- 0 - black screen (no image is displayed).
- 1 - image rendered for the left eye.
- 2 - image rendered for the right eye.
- 3 - stereo image (both the left and right eyes). (by default)
VR::MIRROR_MODE getMirrorMode() const#
Console: vr_mirror_mode
Returns the current mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window. This parameter is stored in the following configuration file: *.boot .
Return value
Current mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window. One of the following values:- 0 - black screen (no image is displayed).
- 1 - image rendered for the left eye.
- 2 - image rendered for the right eye.
- 3 - stereo image (both the left and right eyes). (by default)
void setWindowMode ( VR::WINDOW_MODE mode = 1 ) #
Console: vr_window_mode
Sets a new window mode that defines which window will display the mirrored image (i.e. VR image). This parameter is stored in the following configuration file: *.boot .
Arguments
- VR::WINDOW_MODE mode - The window mode that defines which window will display the mirrored image (i.e. VR image). One of the following values:
- 0 - mirroring is disabled.
- 1 - main window displays the mirrored image. (by default)
VR::WINDOW_MODE getWindowMode() const#
Console: vr_window_mode
Returns the current window mode that defines which window will display the mirrored image (i.e. VR image). This parameter is stored in the following configuration file: *.boot .
Return value
Current window mode that defines which window will display the mirrored image (i.e. VR image). One of the following values:- 0 - mirroring is disabled.
- 1 - main window displays the mirrored image. (by default)
void setTrackingSpace ( VR::TRACKING_SPACE space = 1 ) #
Console: vr_tracking_space
Sets a new zero pose of the tracking origin. This parameter is stored in the following configuration file: *.boot .
Arguments
- VR::TRACKING_SPACE space - The zero pose of the tracking origin. One of the following values:
- 0 - seated.
- 1 - standing. (by default)
- 2 - raw (uncalibrated).
VR::TRACKING_SPACE getTrackingSpace() const#
Console: vr_tracking_space
Returns the current zero pose of the tracking origin. This parameter is stored in the following configuration file: *.boot .
Return value
Current zero pose of the tracking origin. One of the following values:- 0 - seated.
- 1 - standing. (by default)
- 2 - raw (uncalibrated).
void setMotionPrediction ( bool prediction = 0 ) #
Console: vr_motion_prediction
Sets a new value indicating if motion prediction in the Varjo headsets is enabled. When enabled, the engine submits the velocity value from the GBuffer to the Varjo Composer. This parameter is stored in the following configuration file: *.boot .
Arguments
- bool prediction - Set true to enable motion prediction; false - to disable it. The default value is false.
bool isMotionPrediction() const#
Console: vr_motion_prediction
Returns the current value indicating if motion prediction in the Varjo headsets is enabled. When enabled, the engine submits the velocity value from the GBuffer to the Varjo Composer. This parameter is stored in the following configuration file: *.boot .
Return value
true if motion prediction is enabled; otherwise false. The default value is false.void setMotionPredictionVelocityPrecision ( float precision = 32.0f ) #
Sets a new factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Arguments
- float precision - The factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
Range of values: [eps, inf]. The default value is : 32.0f.
float getMotionPredictionVelocityPrecision() const#
Returns the current factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Return value
Current factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).Range of values: [eps, inf]. The default value is : 32.0f.
void setMotionPredictionVelocityTimeDelta ( float delta = 1.0f / 60.0f ) #
Sets a new factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Arguments
- float delta - The factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
Range of values: [eps, inf]. The default value is : 1.0f / 60.0f.
float getMotionPredictionVelocityTimeDelta() const#
Returns the current factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Return value
Current factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.Range of values: [eps, inf]. The default value is : 1.0f / 60.0f.
void setFoveatedRenderingEnabled ( bool enabled = 1 ) #
Console: vr_foveated_rendering_enabled
Sets a new value indicating if foveated rendering is enabled. Foveated rendering makes use of the eye tracking functionality in the Varjo headsets to improve performance by reducing the image quality in peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Arguments
- bool enabled - Set true to enable foveated rendering; false - to disable it. The default value is true.
bool isFoveatedRenderingEnabled() const#
Console: vr_foveated_rendering_enabled
Returns the current value indicating if foveated rendering is enabled. Foveated rendering makes use of the eye tracking functionality in the Varjo headsets to improve performance by reducing the image quality in peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.
This parameter is stored in the following configuration file: *.boot .
This feature is available for the Varjo devices only.
Return value
true if foveated rendering is enabled; otherwise false. The default value is true.const char * getApiName() const#
Returns the current name of the VR API.
Return value
Current name of the VR API.VR::API getApiType() const#
Returns the current type of the VR API.
Return value
Current type of the VR API.float getHMDRefreshRate() const#
Returns the current refresh rate of the head-mounted display.
Return value
Current refresh rate of the HMD.Math::Vec3 getHandTrackingOffset() const#
Returns the current hand tracking offset (for the Ultraleap device only).
Return value
Current hand tracking offset.bool isHandTrackingOffsetSupported() const#
Returns the current value indicating if the hand tracking offset is supported.
Return value
true if the hand tracking offset is supported; otherwise false.bool isPeripheralRenderingModeUsed() const#
Returns the current value indicating if the peripheral rendering is used.
Return value
true if the peripheral rendering is used; otherwise false.bool isHMDConnected() const#
Returns the current value indicating if the head-mounted display is connected.
Return value
true if the HMD is connected; otherwise false.bool isUsingFoveatedRendering() const#
Returns the current value indicating if the foveated rendering is used.
Return value
true if the foveated rendering is used; otherwise false.Ptr<Viewport> getViewport() const#
Returns the current viewport. It can be useful when implementing extra VR logic.
Return value
Current viewport.Math::Mat4 getPlayerIModelview() const#
Returns the current inverse model-view matrix of the camera that renders VR.
Return value
Current inverse model-view matrix.Math::Mat4 getPlayerModelview() const#
Returns the current model-view matrix of the camera that renders VR.
Return value
Current model-view matrix.Math::Mat4 getPlayerWorldTransform() const#
Returns the current world transformation of the camera that renders VR.
Return value
Current world transformation matrix.static Event<bool> getEventRenderModelsVisibility() const#
Event triggered when the render models visibility is changed. You can subscribe to events via
connect()
and unsubscribe via
disconnect(). You can also use
EventConnection
and
EventConnections
classes for convenience (see examples below).
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
// implement the RenderModelsVisibility event handler
void rendermodelsvisibility_event_handler(visible)
{
Log::message("\Handling RenderModelsVisibility event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an instance of the EventConnections
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections rendermodelsvisibility_event_connections;
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connections, rendermodelsvisibility_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connections, [](visible) {
Log::message("\Handling RenderModelsVisibility event (lambda).\n");
}
);
// ...
// later all of these linked subscriptions can be removed with a single line
rendermodelsvisibility_event_connections.disconnectAll();
//////////////////////////////////////////////////////////////////////////////
// 2. You can subscribe and unsubscribe via an instance of the EventConnection
// class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnection class
EventConnection rendermodelsvisibility_event_connection;
// subscribe to the RenderModelsVisibility event with a handler function keeping the connection
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connection, rendermodelsvisibility_event_handler);
// ...
// you can temporarily disable a particular event connection to perform certain actions
rendermodelsvisibility_event_connection.setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
rendermodelsvisibility_event_connection.setEnabled(true);
// ...
// remove subscription to the RenderModelsVisibility event via the connection
rendermodelsvisibility_event_connection.disconnect();
//////////////////////////////////////////////////////////////////////////////
// 3. You can add EventConnection/EventConnections instance as a member of the
// class that handles the event. In this case all linked subscriptions will be
// automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////
// Class handling the event
class SomeClass
{
public:
// instance of the EventConnections class as a class member
EventConnections e_connections;
// A RenderModelsVisibility event handler implemented as a class member
void event_handler(visible)
{
Log::message("\Handling RenderModelsVisibility event\n");
// ...
}
};
SomeClass *sc = new SomeClass();
// ...
// specify a class instance in case a handler method belongs to some class
VR::getEventRenderModelsVisibility().connect(sc->e_connections, sc, &SomeClass::event_handler);
// ...
// handler class instance is deleted with all its subscriptions removed automatically
delete sc;
//////////////////////////////////////////////////////////////////////////////
// 4. Subscribe to an event saving a particular connection ID
// and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;
// define a particular connection ID to be used to unsubscribe later
EventConnectionId rendermodelsvisibility_handler_id;
// subscribe to the RenderModelsVisibility event with a lambda handler function and keeping connection ID
rendermodelsvisibility_handler_id = VR::getEventRenderModelsVisibility().connect(e_connections, [](visible) {
Log::message("\Handling RenderModelsVisibility event (lambda).\n");
}
);
// remove the subscription later using the ID
VR::getEventRenderModelsVisibility().disconnect(rendermodelsvisibility_handler_id);
//////////////////////////////////////////////////////////////////////////////
// 5. Ignoring all RenderModelsVisibility events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventRenderModelsVisibility().setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
VR::getEventRenderModelsVisibility().setEnabled(true);
Return value
Event reference.static Event<> getEventAudioSettingsChanged() const#
Event triggered when the audio settings changed. You can subscribe to events via
connect()
and unsubscribe via
disconnect(). You can also use
EventConnection
and
EventConnections
classes for convenience (see examples below).
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
// implement the AudioSettingsChanged event handler
void audiosettingschanged_event_handler()
{
Log::message("\Handling AudioSettingsChanged event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an instance of the EventConnections
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections audiosettingschanged_event_connections;
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connections, audiosettingschanged_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connections, []() {
Log::message("\Handling AudioSettingsChanged event (lambda).\n");
}
);
// ...
// later all of these linked subscriptions can be removed with a single line
audiosettingschanged_event_connections.disconnectAll();
//////////////////////////////////////////////////////////////////////////////
// 2. You can subscribe and unsubscribe via an instance of the EventConnection
// class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnection class
EventConnection audiosettingschanged_event_connection;
// subscribe to the AudioSettingsChanged event with a handler function keeping the connection
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connection, audiosettingschanged_event_handler);
// ...
// you can temporarily disable a particular event connection to perform certain actions
audiosettingschanged_event_connection.setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
audiosettingschanged_event_connection.setEnabled(true);
// ...
// remove subscription to the AudioSettingsChanged event via the connection
audiosettingschanged_event_connection.disconnect();
//////////////////////////////////////////////////////////////////////////////
// 3. You can add EventConnection/EventConnections instance as a member of the
// class that handles the event. In this case all linked subscriptions will be
// automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////
// Class handling the event
class SomeClass
{
public:
// instance of the EventConnections class as a class member
EventConnections e_connections;
// A AudioSettingsChanged event handler implemented as a class member
void event_handler()
{
Log::message("\Handling AudioSettingsChanged event\n");
// ...
}
};
SomeClass *sc = new SomeClass();
// ...
// specify a class instance in case a handler method belongs to some class
VR::getEventAudioSettingsChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);
// ...
// handler class instance is deleted with all its subscriptions removed automatically
delete sc;
//////////////////////////////////////////////////////////////////////////////
// 4. Subscribe to an event saving a particular connection ID
// and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;
// define a particular connection ID to be used to unsubscribe later
EventConnectionId audiosettingschanged_handler_id;
// subscribe to the AudioSettingsChanged event with a lambda handler function and keeping connection ID
audiosettingschanged_handler_id = VR::getEventAudioSettingsChanged().connect(e_connections, []() {
Log::message("\Handling AudioSettingsChanged event (lambda).\n");
}
);
// remove the subscription later using the ID
VR::getEventAudioSettingsChanged().disconnect(audiosettingschanged_handler_id);
//////////////////////////////////////////////////////////////////////////////
// 5. Ignoring all AudioSettingsChanged events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventAudioSettingsChanged().setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
VR::getEventAudioSettingsChanged().setEnabled(true);
Return value
Event reference.static Event<int> getEventDeviceRenderModelChanged() const#
Event triggered when the render model of the VR device is changed. You can subscribe to events via
connect()
and unsubscribe via
disconnect(). You can also use
EventConnection
and
EventConnections
classes for convenience (see examples below).
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
// implement the DeviceRenderModelChanged event handler
void devicerendermodelchanged_event_handler(vr_device_number)
{
Log::message("\Handling DeviceRenderModelChanged event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an instance of the EventConnections
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections devicerendermodelchanged_event_connections;
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connections, devicerendermodelchanged_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connections, [](vr_device_number) {
Log::message("\Handling DeviceRenderModelChanged event (lambda).\n");
}
);
// ...
// later all of these linked subscriptions can be removed with a single line
devicerendermodelchanged_event_connections.disconnectAll();
//////////////////////////////////////////////////////////////////////////////
// 2. You can subscribe and unsubscribe via an instance of the EventConnection
// class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnection class
EventConnection devicerendermodelchanged_event_connection;
// subscribe to the DeviceRenderModelChanged event with a handler function keeping the connection
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connection, devicerendermodelchanged_event_handler);
// ...
// you can temporarily disable a particular event connection to perform certain actions
devicerendermodelchanged_event_connection.setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
devicerendermodelchanged_event_connection.setEnabled(true);
// ...
// remove subscription to the DeviceRenderModelChanged event via the connection
devicerendermodelchanged_event_connection.disconnect();
//////////////////////////////////////////////////////////////////////////////
// 3. You can add EventConnection/EventConnections instance as a member of the
// class that handles the event. In this case all linked subscriptions will be
// automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////
// Class handling the event
class SomeClass
{
public:
// instance of the EventConnections class as a class member
EventConnections e_connections;
// A DeviceRenderModelChanged event handler implemented as a class member
void event_handler(vr_device_number)
{
Log::message("\Handling DeviceRenderModelChanged event\n");
// ...
}
};
SomeClass *sc = new SomeClass();
// ...
// specify a class instance in case a handler method belongs to some class
VR::getEventDeviceRenderModelChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);
// ...
// handler class instance is deleted with all its subscriptions removed automatically
delete sc;
//////////////////////////////////////////////////////////////////////////////
// 4. Subscribe to an event saving a particular connection ID
// and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;
// define a particular connection ID to be used to unsubscribe later
EventConnectionId devicerendermodelchanged_handler_id;
// subscribe to the DeviceRenderModelChanged event with a lambda handler function and keeping connection ID
devicerendermodelchanged_handler_id = VR::getEventDeviceRenderModelChanged().connect(e_connections, [](vr_device_number) {
Log::message("\Handling DeviceRenderModelChanged event (lambda).\n");
}
);
// remove the subscription later using the ID
VR::getEventDeviceRenderModelChanged().disconnect(devicerendermodelchanged_handler_id);
//////////////////////////////////////////////////////////////////////////////
// 5. Ignoring all DeviceRenderModelChanged events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventDeviceRenderModelChanged().setEnabled(false);
// ... actions to be performed
// and enable it back when necessary
VR::getEventDeviceRenderModelChanged().setEnabled(true);
Return value
Event reference.bool isSteamVRDashboardActive() const#
Returns the current value indicating if the SteamVR controllers are rendered. When you access the SteamVR menu during the application runtime, the SteamVR controllers start to be rendered along with the application controllers. You can use this function to check the state of the SteamVR controllers and disable the application controllers to avoid performance drops caused by the simultaneous rendering of both controllers.
Return value
true if the SteamVR controllers are rendered is enabled; otherwise false.VR::RUNTIME_TYPE getInputRuntimeType() const#
Returns the current type of the VR input runtime.
Return value
Current type of the VR input runtime.const char * getInputRuntimeName() const#
Returns the current name of the VR input runtime.
Return value
Current name of the VR input runtime.void setDebugMode ( VR::DEBUG_MODE mode ) #
Sets a new debug mode for VR. If the debug mode is disabled, displaying of GAPI errors in VR runtime is also disabled.
Arguments
- VR::DEBUG_MODE mode - The debug mode for VR.
VR::DEBUG_MODE getDebugMode() const#
Returns the current debug mode for VR. If the debug mode is disabled, displaying of GAPI errors in VR runtime is also disabled.
Return value
Current debug mode for VR.Math::ivec2 getHMDResolution ( VR::VIEWPORT_TYPE viewport_type = Enum.VR.VIEWPORT_TYPE.CONTEXT ) const#
Returns the current resolution of the head-mounted display. For HMDs having context (peripheral) and focus displays, you should specify the viewport type.Arguments
- VR::VIEWPORT_TYPE viewport_type - Type of the viewport (for HMDs having context (peripheral) and focus displays).
Return value
HMD resolution.bool hasFeatureMixedReality ( ) const#
Returns a value indicating if the mixed reality mode is available. Mixed reality enables you to combine real-world view from front-facing cameras mounted on the headset with the VR image rendered. This feature is available for the Varjo devices only.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureEyeTracking ( ) const#
Returns a value indicating if eye tracking is available. This feature is available for the Varjo devices only.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureHandTracking ( ) const#
Returns a value indicating if hand tracking is available. This feature is available for the Varjo devices only.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureTrackingSpaceRaw ( ) const#
Returns a value indicating if poses can be provided in the coordinate system defined by the tracker driver.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureMotionPrediction ( ) const#
Returns a value indicating if motion prediction is available. This feature is available for the Varjo devices only. It allows the engine to submit the velocity from the GBuffer to the Varjo Composer.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureFoveatedRendering ( ) const#
Returns a value indicating if foveated rendering is available. This feature is available for the Varjo devices only. Foveated rendering enhances performance by using the eye tracking functionality in Varjo headsets: it decreases the image quality in the peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureReportProximitySensor ( ) const#
Returns a value indicating if proximity sensor reporting is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureSupportForTreadmill ( ) const#
Returns a value indicating if the user treadmill support is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureSupportForBaseStations ( ) const#
Returns a value indicating if the base stations support is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureSupportForTrackers ( ) const#
Returns a value indicating if support for trackers is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureSupportForRenderModelComponents ( ) const#
Returns a value indicating if support for render model components is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool resetZeroPose ( ) const#
Sets the zero pose to the current tracker position.Return value
true if the pose is reset successfully; otherwise, false.bool hasFeatureSupportForRenderModel ( ) const#
Returns a value indicating if VR API can provide Render Models for the controllers.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureFadeToColor ( ) const#
Returns a value indicating if the FadeToColor feature is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureFadeGrid ( ) const#
Returns the value indicating if the FadeGrid feature is available.If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool hasFeatureGetAudioDevice ( ) const#
Returns the value indicating if VR API can return Audio Device name (usually Oculus only).If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.void fadeToColor ( float seconds, const Math::vec4 & color, bool background ) #
Fades the engine render to the specified color over time.Arguments
- float seconds - Fade period, in seconds.
- const Math::vec4 & color - Target color.
- bool background
void fadeGrid ( float seconds, bool fade_in ) #
Fades the engine render to/from the grid over the specified time.Arguments
- float seconds - Fade period, in seconds.
- bool fade_in - true fades render to grid; false fades grid to render.
Last update:
2024-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)