Unigine.VR Class
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 12
- Vulkan
Notice
For OpenGL API support, use the corresponding VR plugins (deprecated).
VR Class
Enums
API#
Name | Description |
---|---|
NULL = 0 | VR API is not initialized. |
VARJO = 1 | Varjo API. |
OPENVR = 2 | OpenVR API. |
OPENXR = 3 | OpenXR API. |
VIEWPORT_TYPE#
Name | Description |
---|---|
CONTEXT = 0 | Context (low-res) viewport. |
FOCUS = 1 | Focus (high-res) viewport. |
NUM = 2 | Number of viewport types. |
EYE_TYPE#
Name | Description |
---|---|
LEFT = 0 | Left eye. |
RIGHT = 1 | Right eye. |
NUM = 2 | Number of eye types. |
MIRROR_MODE#
WINDOW_MODE#
TRACKING_SPACE#
DEBUG_MODE#
RUNTIME_TYPE#
Properties
bool RenderEnabled#
Console: vr_render_enabled
The value indicating if rendering into the head-mounted display is enabled.
The default value is false.bool PeripheralRenderingModeEnabled#
Console: vr_peripheral_rendering_mode_enabled
The 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.
The default value is true.bool PeripheralRenderingDebugEnabled#
The value indicating if debug visualization for peripheral rendering is enabled.
The default value is true.float PeripheralRenderingBorderWidth#
Console: vr_peripheral_rendering_border_width
The width of the transition border between foveal (focus) and context rendering zones. A value of 1.0 means the entire viewport has a wide, smooth transition. A very small value (close to epsilon) means the transition will be extremely narrow and almost invisible.
Range of values: [eps, 1.0f]. The default value is : 0.2f.
vec2 PeripheralRenderingFOVScale#
Console: vr_peripheral_rendering_fov_scale
The scale factor applied to the field of view used for focus viewports.
[-1; 1] - available range.
(0.3f, 0.3f) - default value.
vec2 PeripheralRenderingFocusScale#
Console: vr_peripheral_rendering_focus_scale
The scale factor controlling the size of the foveal (focus) area.
[-1; 1] - available range.
(0.5f, 0.2f) - default value.
float PeripheralRenderingFocusDeadzone#
The angular deadzone between the focus and context viewport transition.
Range of values: [0.0f, 1.0f]. The default value is : 0.15f.
VR.MIRROR_MODE MirrorMode#
Console: vr_mirror_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.WINDOW_MODE WindowMode#
Console: vr_window_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.TRACKING_SPACE TrackingSpace#
Console: vr_tracking_space
The zero pose of the tracking origin.
One of the following values:- 0 - seated.
- 1 - standing. (by default)
- 2 - raw (uncalibrated).
bool MotionPrediction#
Console: vr_motion_prediction
The 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.
The default value is false.float MotionPredictionVelocityPrecision#
The factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
Notice
This feature is available for the Varjo devices only.
Range of values: [eps, inf]. The default value is : 32.0f.
float MotionPredictionVelocityTimeDelta#
The factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
Notice
This feature is available for the Varjo devices only.
Range of values: [eps, inf]. The default value is : 1.0f / 60.0f.
bool FoveatedRenderingEnabled#
Console: vr_foveated_rendering_enabled
The 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.
The default value is true.Notice
This feature is available for the Varjo devices only.
string ApiName#
The name of the VR API: Null, OpenVR, OpenXR, or Varjo.
VR.API ApiType#
The type of the VR API.
float HMDRefreshRate#
The refresh rate of the head-mounted display.
vec3 HandTrackingOffset#
The hand tracking offset (for the Ultraleap device only).
bool IsHandTrackingOffsetSupported#
The value indicating if the hand tracking offset is supported.
bool IsPeripheralRenderingModeUsed#
The value indicating if the peripheral rendering is used.
bool IsHMDConnected#
The value indicating if the head-mounted display is connected.
bool IsUsingFoveatedRendering#
The value indicating if the foveated rendering is used.
Viewport Viewport#
The viewport. It can be useful when implementing extra VR logic.
mat4 PlayerIModelview#
The inverse model-view matrix of the camera that renders VR.
mat4 PlayerModelview#
The model-view matrix of the camera that renders VR.
mat4 PlayerWorldTransform#
The world transformation of the camera that renders VR.
Event<bool> EventRenderModelsVisibility#
The 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).
bool visible )
Notice
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
Source code (C#)
// implement the RenderModelsVisibility event handler
void rendermodelsvisibility_event_handler(bool visible)
{
Log.Message("\Handling RenderModelsVisibility event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an EventConnections instance
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections rendermodelsvisibility_event_connections = new EventConnections();
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR.EventRenderModelsVisibility.Connect(rendermodelsvisibility_event_connections, rendermodelsvisibility_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR.EventRenderModelsVisibility.Connect(rendermodelsvisibility_event_connections, (bool 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 the handler function directly
//////////////////////////////////////////////////////////////////////////////
// subscribe to the RenderModelsVisibility event with a handler function
VR.EventRenderModelsVisibility.Connect(rendermodelsvisibility_event_handler);
// remove subscription to the RenderModelsVisibility event later by the handler function
VR.EventRenderModelsVisibility.Disconnect(rendermodelsvisibility_event_handler);
//////////////////////////////////////////////////////////////////////////////
// 3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////
// define a connection to be used to unsubscribe later
EventConnection rendermodelsvisibility_event_connection;
// subscribe to the RenderModelsVisibility event with a lambda handler function and keeping the connection
rendermodelsvisibility_event_connection = VR.EventRenderModelsVisibility.Connect((bool visible) => {
Log.Message("Handling RenderModelsVisibility event lambda\n");
}
);
// ...
// you can temporarily disable a particular event connection
rendermodelsvisibility_event_connection.Enabled = false;
// ... perform certain actions
// and enable it back when necessary
rendermodelsvisibility_event_connection.Enabled = true;
// ...
// remove the subscription later using the saved connection
rendermodelsvisibility_event_connection.Disconnect();
//////////////////////////////////////////////////////////////////////////////
// 4. Ignoring RenderModelsVisibility events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR.EventRenderModelsVisibility.Enabled = false;
// ... actions to be performed
// and enable it back when necessary
VR.EventRenderModelsVisibility.Enabled = true;
Event EventAudioSettingsChanged#
The 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).
)
Notice
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
Source code (C#)
// implement the AudioSettingsChanged event handler
void audiosettingschanged_event_handler()
{
Log.Message("\Handling AudioSettingsChanged event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an EventConnections instance
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections audiosettingschanged_event_connections = new EventConnections();
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR.EventAudioSettingsChanged.Connect(audiosettingschanged_event_connections, audiosettingschanged_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR.EventAudioSettingsChanged.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 the handler function directly
//////////////////////////////////////////////////////////////////////////////
// subscribe to the AudioSettingsChanged event with a handler function
VR.EventAudioSettingsChanged.Connect(audiosettingschanged_event_handler);
// remove subscription to the AudioSettingsChanged event later by the handler function
VR.EventAudioSettingsChanged.Disconnect(audiosettingschanged_event_handler);
//////////////////////////////////////////////////////////////////////////////
// 3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////
// define a connection to be used to unsubscribe later
EventConnection audiosettingschanged_event_connection;
// subscribe to the AudioSettingsChanged event with a lambda handler function and keeping the connection
audiosettingschanged_event_connection = VR.EventAudioSettingsChanged.Connect(() => {
Log.Message("Handling AudioSettingsChanged event lambda\n");
}
);
// ...
// you can temporarily disable a particular event connection
audiosettingschanged_event_connection.Enabled = false;
// ... perform certain actions
// and enable it back when necessary
audiosettingschanged_event_connection.Enabled = true;
// ...
// remove the subscription later using the saved connection
audiosettingschanged_event_connection.Disconnect();
//////////////////////////////////////////////////////////////////////////////
// 4. Ignoring AudioSettingsChanged events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR.EventAudioSettingsChanged.Enabled = false;
// ... actions to be performed
// and enable it back when necessary
VR.EventAudioSettingsChanged.Enabled = true;
Event<int> EventDeviceRenderModelChanged#
The 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).
int vr_device_number )
Notice
The event handler signature is as follows: myhandler(For more details see the Event Handling article.
Usage Example
Source code (C#)
// implement the DeviceRenderModelChanged event handler
void devicerendermodelchanged_event_handler(int vr_device_number)
{
Log.Message("\Handling DeviceRenderModelChanged event\n");
}
//////////////////////////////////////////////////////////////////////////////
// 1. Multiple subscriptions can be linked to an EventConnections instance
// class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////
// create an instance of the EventConnections class
EventConnections devicerendermodelchanged_event_connections = new EventConnections();
// link to this instance when subscribing to an event (subscription to various events can be linked)
VR.EventDeviceRenderModelChanged.Connect(devicerendermodelchanged_event_connections, devicerendermodelchanged_event_handler);
// other subscriptions are also linked to this EventConnections instance
// (e.g. you can subscribe using lambdas)
VR.EventDeviceRenderModelChanged.Connect(devicerendermodelchanged_event_connections, (int 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 the handler function directly
//////////////////////////////////////////////////////////////////////////////
// subscribe to the DeviceRenderModelChanged event with a handler function
VR.EventDeviceRenderModelChanged.Connect(devicerendermodelchanged_event_handler);
// remove subscription to the DeviceRenderModelChanged event later by the handler function
VR.EventDeviceRenderModelChanged.Disconnect(devicerendermodelchanged_event_handler);
//////////////////////////////////////////////////////////////////////////////
// 3. Subscribe to an event and unsubscribe later via an EventConnection instance
//////////////////////////////////////////////////////////////////////////////
// define a connection to be used to unsubscribe later
EventConnection devicerendermodelchanged_event_connection;
// subscribe to the DeviceRenderModelChanged event with a lambda handler function and keeping the connection
devicerendermodelchanged_event_connection = VR.EventDeviceRenderModelChanged.Connect((int vr_device_number) => {
Log.Message("Handling DeviceRenderModelChanged event lambda\n");
}
);
// ...
// you can temporarily disable a particular event connection
devicerendermodelchanged_event_connection.Enabled = false;
// ... perform certain actions
// and enable it back when necessary
devicerendermodelchanged_event_connection.Enabled = true;
// ...
// remove the subscription later using the saved connection
devicerendermodelchanged_event_connection.Disconnect();
//////////////////////////////////////////////////////////////////////////////
// 4. Ignoring DeviceRenderModelChanged events when necessary
//////////////////////////////////////////////////////////////////////////////
// you can temporarily disable the event to perform certain actions without triggering it
VR.EventDeviceRenderModelChanged.Enabled = false;
// ... actions to be performed
// and enable it back when necessary
VR.EventDeviceRenderModelChanged.Enabled = true;
bool IsSteamVRDashboardActive#
The 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.
VR.RUNTIME_TYPE InputRuntimeType#
The type of the VR input runtime.
string InputRuntimeName#
The name of the VR input runtime.
string InputRuntimeVersion#
The version of the VR input runtime.
VR.DEBUG_MODE DebugMode#
The debug mode for VR. If the debug mode is disabled, displaying of GAPI errors in VR runtime is also disabled.
bool RenderWhileHMDIdle#
The value indicating if rendering is enabled while HMD is not worn.
float EyeNativeFOV#
The device-native vertical field of view in radians (measured from the left eye).
float EyeOverrideFOV#
The vertical field of view override value (in degrees).
bool IsEyeOverriddenFOV#
The value indicating if the native vertical field of view value has been overridden (i.e., differs from the native field of view).
Members
ivec2 GetHMDResolution ( VR.VIEWPORT_TYPE viewport_type = Enum.VR.VIEWPORT_TYPE.CONTEXT ) #
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 ( ) #
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.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureEyeTracking ( ) #
Returns a value indicating if eye tracking is available. This feature is available for the Varjo devices only.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureHandTracking ( ) #
Returns a value indicating if hand tracking is available. This feature is available for the Varjo devices only.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureTrackingSpaceRaw ( ) #
Returns a value indicating if poses can be provided in the coordinate system defined by the tracker driver.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureMotionPrediction ( ) #
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.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureFoveatedRendering ( ) #
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.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureReportProximitySensor ( ) #
Returns a value indicating if proximity sensor reporting is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureSupportForTreadmill ( ) #
Returns a value indicating if the user treadmill support is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureSupportForBaseStations ( ) #
Returns a value indicating if the base stations support is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureSupportForTrackers ( ) #
Returns a value indicating if support for trackers is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureSupportForRenderModelComponents ( ) #
Returns a value indicating if support for render model components is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.static bool ResetZeroPose ( ) #
Sets the zero pose to the current tracker position.Return value
true if the pose is reset successfully; otherwise, false.bool HasFeatureSupportForRenderModel ( ) #
Returns a value indicating if VR API can provide Render Models for the controllers.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureFadeToColor ( ) #
Returns a value indicating if the FadeToColor feature is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureFadeGrid ( ) #
Returns the value indicating if the FadeGrid feature is available.Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.bool HasFeatureGetAudioDevice ( ) #
Returns the value indicating if VR API can return Audio Device name (usually Oculus only).Notice
If VR is not initialized, the function will return false.
Return value
true if the feature is available; otherwise, false.void FadeToColor ( float seconds, vec4 color, bool background ) #
Fades the engine render to the specified color over time.Arguments
- float seconds - Fade period, in seconds.
- 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.
void ClearScriptableMaterials ( VR.EYE_TYPE eye ) #
Removes all scriptable materials assigned to the target eye.Arguments
- VR.EYE_TYPE eye - Target eye.
int GetNumScriptableMaterials ( VR.EYE_TYPE eye ) #
Returns the number of scriptable materials currently assigned to the specified eye.Arguments
- VR.EYE_TYPE eye - Target eye.
Return value
Number of scriptable materials currently assigned to the specified eye.Material GetScriptableMaterial ( VR.EYE_TYPE eye, int num ) #
Returns the scriptable material assigned to the target eye by the number. The material's number determines the order in which the expressions assigned to it are executed.Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
Return value
Scriptable material assigned to the target eye.void SetScriptableMaterial ( VR.EYE_TYPE eye, int num, Material material ) #
Replaces the specified scriptable material with a new scriptable material by its number for the target eye. The material's number determines the order in which the expressions assigned to it are executed.Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-eye.
Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
- Material material - New scriptable material to replace the one with the specified number.
void InsertScriptableMaterial ( VR.EYE_TYPE eye, int num, Material material ) #
Inserts a new scriptable material at the specified position for the target eye. The material's number determines the order in which the expressions assigned to it are executed. To apply a scriptable material globally, use the InsertScriptableMaterial() method of the Render class.Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-eye.
Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Position at which the new scriptable material is to be inserted.
- Material material - Scriptable material to be inserted.
int FindScriptableMaterial ( VR.EYE_TYPE eye, Material material ) #
Returns the number of the specified scriptable material for the target eye. The material's number determines the order in which the expressions assigned to it are executed.Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-eye.
Arguments
- VR.EYE_TYPE eye - Target eye.
- Material material - Scriptable material for which the number is to be found.
Return value
The number of the specified scriptable material for the target eye.void AddScriptableMaterial ( VR.EYE_TYPE eye, Material material ) #
Adds the specified scriptable material to the target eye's material list. The material's number determines the order in which the expressions assigned to it are executed. To apply a scriptable material globally, use the AddScriptableMaterial() method of the Render class.Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-eye.
Arguments
- VR.EYE_TYPE eye - Target eye.
- Material material - Scriptable material to add.
void RemoveScriptableMaterial ( VR.EYE_TYPE eye, int num ) #
Removes the scriptable material with the specified number from the target eye's material list.Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
void SwapScriptableMaterials ( VR.EYE_TYPE eye, int num_0, int num_1 ) #
Swaps two scriptable materials with the specified numbers in the target eye's material list. The material's number determines the order in which the expressions assigned to it are executed.Arguments
- VR.EYE_TYPE eye - Target eye.
- int num_0 - Number of the first scriptable material in the range from 0 to the total number of scriptable materials.
- int num_1 - Number of the second scriptable material in the range from 0 to the total number of scriptable materials.
void SetScriptableMaterialEnabled ( VR.EYE_TYPE eye, int num, bool enabled ) #
Enables or disables the scriptable material with the specified number for the target eye. When a material is disabled (inactive), the scripts attached to it are not executed.Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
- bool enabled - true to enable the scriptable material with the specified number, false to disable it.
bool GetScriptableMaterialEnabled ( VR.EYE_TYPE eye, int num ) #
Returns a value indicating if the scriptable material with the specified number is enabled (active) for the target eye. When a material is disabled (inactive), the scripts attached to it are not executed.Arguments
- VR.EYE_TYPE eye - Target eye.
- int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
Return value
true if the scriptable material with the specified number is enabled; otherwise, false.void SetEyeOffset ( VR.EYE_TYPE eye, mat4 offset ) #
Sets a custom transformation matrix to be applied to the target eye.Arguments
- VR.EYE_TYPE eye - Target eye.
- mat4 offset - Transformation matrix to be applied to the target eye.
mat4 GetEyeOffset ( VR.EYE_TYPE eye ) #
Returns the current transformation matrix applied to the target eye.Arguments
- VR.EYE_TYPE eye - Target eye.
Return value
Transformation matrix currently applied to the target eye.void ResetEyeOffset ( VR.EYE_TYPE eye ) #
Resets the transformation offset of the target eye to the identity matrix.Arguments
- VR.EYE_TYPE eye - Target eye.
void ResetEyeOffset ( ) #
Resets the transformation offsets for both eyes to the identity matrix.void ResetEyeOverrideFOV ( ) #
Resets the vertical field of view override to the native value.The information on this page is valid for UNIGINE 2.20 SDK.
Last update:
2025-06-30
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)