This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.Plugins.Varjo Class

This set of functions is available when the Varjo plugin is loaded.

If Varjo plugin is loaded together with the engine, the HAS_VARJO definition is set. This definition can be used, for example, to avoid errors if the plugin is not loaded; the code in which the plugin functions are executed can be wrapped around as follows:

Source code (UnigineScript)
#ifdef HAS_VARJO
	// Varjo functions
#endif

Varjo Class

Enums

EYE_STATUS#

NameDescription
INVALID = 0Eye is not tracked and not visible (for example, eye is shut).
VISIBLE = 1Eye is visible but not reliably tracked (for example, saccade or blink).
COMPENSATED = 2Eye is tracked but quality compromised (for example, headset has moved after calibration).
TRACKED = 3Eye is tracked.

EYETRACKING_STATUS#

NameDescription
INVALID = 0Data is not available, user is not wearing the device or eyes cannot be found.
ADJUST = 1User is wearing the device, but gaze tracking is being calibrated.
VALID = 2Data is valid.

CONTROLLER_ROLE#

NameDescription
INVALID = 0Invalid value for controller type.
LEFT_HAND = 1Tracked device is associated with the left hand.
RIGHT_HAND = 2Tracked device is associated with the right hand.
OPT_OUT = 3Tracked device is opting out of left/right hand.
TREADMILL = 4Tracked device is a treadmill.
MAX = 5Indicates the maximum number of controller roles.

BUTTON#

NameDescription
SYSTEM = 0The system button. These events are not visible to applications and are used internally to bring up the Steam Overlay or the Steam Client.
APPLICATIONMENU = 1The application menu button.
GRIP = 2The grip button.
DPAD_LEFT = 3The sensor panel left button.
DPAD_UP = 4The sensor panel up button.
DPAD_RIGHT = 5The sensor panel right button.
DPAD_DOWN = 6The sensor panel down button.
A = 7The button reserved for manual controllers.
AXIS0 = 32The axis reserved for manual controllers.
AXIS1 = 33The axis reserved for manual controllers.
AXIS2 = 34The axis reserved for manual controllers.
AXIS3 = 35The axis reserved for manual controllers.
AXIS4 = 36The axis reserved for manual controllers.
STEAMVR_TOUCHPAD = 32The touchpad on the SteamVR controller. It is the same as BUTTON_AXIS0.
STEAMVR_TRIGGER = 33The trigger on the SteamVR controller. It is the same as BUTTON_AXIS1.
DASHBOARD_BACK = 2The back to dashboard button.
MAX = 64This is not an actual button. It just indicates the maximum number of buttons in the system.

AXIS#

NameDescription
NONE = 0No axis is identified on the controller.
TRACKPAD = 1An axis of a trackpad type.
JOYSTICK = 2An axis of a joystick type.
TRIGGER = 3An axis of a trigger type.

DEVICE#

NameDescription
INVALID = 0A tracked device with an invalid index.
HMD = 1A tracked head-mounted display.
CONTROLLER = 2A tracked controller.
GENERIC_TRACKER = 3A tracked tracker device.
TRACKING = 4A tracked camera and base stations that serve as tracking reference points.

VIEWPORT#

NameDescription
BLACK_SCREEN = 0No image (black screen).
MONO = 1Mono image.
STEREO = 2Stereo image (left and right eye).

CHROMAKEY_TYPE#

Chroma key config type. Each chroma key configuration index has a config type, which can be used to determine if the slot in the current index is being used. Active configurations have the HSV type.
NameDescription
DISABLED = 0Disabled chroma key config.
HSV = 1HSV chroma key config.

MARKER_POSE_FLAGS#

NameDescription
TRACING_OK = 0x1Pose is being currently tracked.
TRACING_LOST = 0x2Pose has been tracked but currently is not detected by the tracking subsystem.
TRACING_DISCONNECTED = 0x4Tracking subsystem is not connected and poses cannot be acquired.
HAS_POSITION = 0x8Pose has position information.
HAS_ROTATION = 0x10Pose has rotation information.
HAS_VELOCITY = 0x20Pose has velocity information.
HAS_ANGULAR_VELOCITY = 0x40Pose has angular velocity information.
HAS_ACCELERATION = 0x80Pose has acceleration information.
HAS_CONFIDENCE = 0x100Pose has confidence information.

MARKER_FLAGS#

NameDescription
DO_PREDICTION = 0x1Marker pose is predicted. If not specified, the latest detected pose is used.

ENVIRONMENT_MODE#

NameDescription
PRESET = 0Environment mode that sets the cubemap defining the color for the environment preset that retains the sky color, haze, etc.
OVERLAP = 1Environment mode that sets the environment texture substituting the sky.

HMD_TYPE#

Head-mounted display type.
NameDescription
VR_1 = 0Varjo VR-1 head-mounted display.
XR_1 = 1Varjo XR-1 head-mounted display.
VR_2 = 2Varjo VR-2 head-mounted display.
VR_2_PRO = 3Varjo VR-2 Pro head-mounted display.
VR_3 = 4Varjo VR-3 head-mounted display.
XR_3 = 5Varjo XR-3 head-mounted display.
AERO = 6Varjo Aero head-mounted display.
UNKNOWN = 7Unknown head-mounted display.

BLEND_MASKING_MODE#

NameDescription
DISABLED = 0Masking mode is disabled.
RESTRICT_VIDEO_TO_MASK = 1Show the video pass-through image (VST) in the mask. Can be used with chroma key.
RESTRICT_VR_TO_MASK = 2Show VR in the mask. Can be used with chroma key.
RESTRICT_VR_TO_CHROMAKEY_REDUCED_BY_MASK = 3Show VR in the mask and chroma elsewhere. Requires chroma key.

Properties

bool VisualizerEnabled#

The value indicating if visualizer is enabled.

long FrameNum#

The unique identifier of the frame when the data was recorded.

Varjo.EYE_STATUS RightEyeStatus#

The value representing the tracking status for the right eye.

Varjo.EYE_STATUS LeftEyeStatus#

The value representing the tracking status for the left eye.

Varjo.EYETRACKING_STATUS EyeTrackingStatus#

The value representing the status of eye tracking in the Varjo headsets.

double Stability#

The value between 0.0 and 1.0 specifying the stability of the user’s focus. 0.0 means not stable and 1.0 means stable.

double FocusDistance#

The distance between the eye and the focus point. It is a value between 0 and 2 meters.

long CaptureTime#

The timestamp of when the data was recorded, in nanoseconds.

double RightEyePupilSize#

The size of the right eye pupil, the value between 0 and 1 calculated according to the pupil size range detected by the Varjo headset.

double LeftEyePupilSize#

The size of the left eye pupil, the value between 0 and 1 calculated according to the pupil size range detected by the Varjo headset.

vec3 GazeWorldDirection#

The gaze direction vector, which is a combined value for both eyes, in world coordinates.

vec3 RightEyeWorldDirection#

The direction vector of the right eye in world coordinates.

vec3 RightEyeWorldPosition#

The position of the right eye in world coordinates.

vec3 LeftEyeWorldDirection#

The direction vector of the left eye in world coordinates.

vec3 LeftEyeWorldPosition#

The position of the left eye in world coordinates.

vec3 FocusWorldPosition#

The position of the eye focus point in world coordinates.

bool IsEyeTrackingValid#

The true if eye tracking is valid; otherwise - false.

int CameraSharpness#

The sharpness filter power value for the camera.

int CameraFlickerCompensation#

The flicker compensation value for the camera.

int CameraISO#

The ISO value for the camera.

int CameraWhiteBalance#

The white balance correction value for the camera.

double CameraExposureTime#

The exposure time for the camera.

int ChromaKeyConfigNum#

The number of chroma key config indices supported. The maximum index will be count-1.

bool ChromaKey#

The value indicating if chroma keying is enabled.

int MarkerObjectNum#

The number of visible marker objects.

bool FoveatedRenderingEnabled#

The value indicating if foveated rendering is enabled. Foveated rendering makes use of the eye tracking functionality in 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.

int StreamEnvironmentCubemapPresetIndex#

The index of the environment preset to which the texture is set.

Varjo.ENVIRONMENT_MODE StreamEnvironmentCubemapMode#

The mode defining the way the AR texture is set for the environment.

double ViewOffset#

The eyes view offset.

dvec2 DepthTestRange#

The depth testing range as a two-component vector.

float StreamEnvironmentCubemapGGXQuality#

The quality of the generated GGX mips for the AR cubemap.

bool StreamColorCorrectionEnabled#

The value indicating if the AR cameras streaming exposition is enabled.

bool StreamEnvironmentCubemapEnabled#

The value indicating if the cubemap streaming from AR cameras is enabled.

bool DepthTestRangeEnabled#

The value indicating if depth testing range is enabled. Use DepthTestRange ( Depth Test Near Z, Depth Test Far Z) to control the range for which the depth test is evaluated.

bool DepthTest#

The value indicating if depth testing is enabled.

bool Video#

The value indicating if video signal from the real-world view from the front-facing HMD-mounted cameras is enabled. The real-world view is used for combining virtual and real-world elements to create an immersive experience in mixed reality.

bool AlphaInvert#

The value indicating if alpha channel is inverted before using it for blending VR and AR images.

bool AlphaBlend#

The value indicating if alpha blending is enabled. This option enables blending VR and AR images using the alpha channel.

bool MarkerTrackingEnabled#

The value indicating if marker tracking is enabled.

bool IsMixedRealityAvailable#

The a value indicating if 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.

Varjo.VIEWPORT ViewportMode#

The a value indicating the current viewport mode, that determines the type of image to be displayed in the viewport.

vec3 HandtrackingOffset#

The Offset used for hand tracking (offset for the hand position). This is necessary because the head tracking point for your HMD differs from the hand tracking point for Ultraleap.

Varjo.HMD_TYPE HMDType#

The type of the head-mounted display. One of the HMD_TYPE.* values.

string HMDName#

The name of the head-mounted display.

float MotionPredictionVelocityTimeDelta#

The factor for optimizing between fast and slow moving objects.

float MotionPredictionVelocityPrecision#

The factor of velocity scale before packing floating point value into 2x8 bit uint.

bool MotionPrediction#

The true if support for Motion Prediction is enabled; otherwise - false.

bool BlendMaskingDebugEnabled#

The true if blend masking debug visualization is enabled; otherwise - false.

Varjo.BLEND_MASKING_MODE BlendMaskingMode#

The Masking mode. One of the BLEND_MASKING_MODE variables.

bool StreamColorCorrectionWhiteBalanceEnabled#

The true if white balance correction for the stream is enabled; otherwise - false.

float FocusViewportSupersamplingFactor#

The Additional supersampling factor.

bool HeadPositionLock#

The value indicating if the head position is locked.

bool HeadRotationLock#

The value indicating if the head rotation is locked.

Members


int GetMaxTrackedDeviceCount ( ) #

Returns the maximum value of tracked devices.

Return value

The maximum value of tracked devices.

int GetControllerStateAxisCount ( ) #

Returns a number of axes.

Return value

Number of axes.

mat4 GetDevicePose ( int device_num ) #

Returns a single pose for a tracked device.

Arguments

  • int device_num - Device ID.

Return value

Identity matrix.

vec3 GetDeviceVelocity ( int device_num ) #

Returns a device velocity in tracker space, in meters per second.

Arguments

  • int device_num - Device ID.

Return value

Velocity.

vec3 GetDeviceAngularVelocity ( int device_num ) #

Returns a device angular velocity, in radians per second.

Arguments

  • int device_num - Device ID.

Return value

Angular velocity.

bool IsDeviceConnected ( int device_num ) #

Returns a value indicating if the device connected to the slot.

Arguments

  • int device_num - Device ID.

Return value

true - connected; false - not connected.

bool IsPoseValid ( int device_num ) #

Returns a value indicating if the device pose is valid.

Arguments

  • int device_num - Device ID.

Return value

true - valid; false - invalid.

int GetTrackingResult ( int device_num ) #

Returns the value indicating the tracking result:
  • Uninitialized
  • Calibrating in progress
  • Calibrating out of range
  • Running correctly
  • Running out of range

Arguments

  • int device_num - Device ID.

Return value

Tracking result.

Varjo.DEVICE GetDeviceType ( int device_num ) #

Returns the device type.

Arguments

  • int device_num - Device ID.

Return value

Device type, one of the DEVICE variables.

Varjo.AXIS GetDeviceAxisType ( int device_num, int axis_num ) #

Returns the value that identifies what type of axis is on the indicated controller.

Arguments

  • int device_num - Device ID.
  • int axis_num - Axis number.

Return value

Axis of a corresponding type. One of the AXIS variables.

int GetControllerPacketNum ( int device_num ) #

Returns the number of the controller packet.

Arguments

  • int device_num - Device ID.

Return value

Number of the controller packet.

bool GetControllerButtonPressed ( int device_num, Varjo.BUTTON button ) #

Returns the value indicating if the specified button is pressed.

Arguments

Return value

true if the button is pressed; otherwise - false.

bool GetControllerButtonTouched ( int device_num, Varjo.BUTTON button ) #

Returns the value indicating if the specified button is touched.

Arguments

Return value

true if the button is pressed; otherwise - false.

vec2 GetControllerAxis ( int device_num, int axis_num ) #

Returns the coordinates of the specified controller axis along the X and Y axes.

Arguments

  • int device_num - Device ID.
  • int axis_num - Axis number.

Return value

X and Y in the range of [-1;1] ([0;1] for a trigger).

void SetControllerVibration ( int device_num, ushort duration ) #

Sets the vibration of the given duration and amplitude.

Arguments

  • int device_num - Device ID.
  • ushort duration - Duration of the vibration.

void RequestCalibration ( ) #

Triggers the gaze calibration sequence, if gaze tracking has been enabled in Varjo settings and the Varjo system is in a state where it can bring up the calibration UI.

Varjo.CONTROLLER_ROLE GetControllerRole ( int device_num ) #

Returns a specific role associated with a tracked device.

Arguments

  • int device_num - Device ID.

Return value

Role associated with a tracked device. One of the CONTROLLER_ROLE variables.

string GetDeviceManufacturerName ( int device ) #

Returns the manufacturer name of the specified device.

Arguments

  • int device - Device ID.

Return value

Manufacturer name.

string GetDeviceModelNumber ( int device ) #

Returns the model number of the specified device.

Arguments

  • int device - Device ID.

Return value

Model number.

void ChromaKeyConfigSubmit ( int index ) #

Applies the chroma key configuration with the specified index.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.

Varjo.CHROMAKEY_TYPE GetChromaKeyConfigType ( int index ) #

Returns the type of the chroma key configuration with the specified index. Each chroma key configuration index has a config type, which can be used to determine if the slot in the current index is being used. Active configurations have the HSV type.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.

Return value

Chroma key configuration type.

void SetChromaKeyConfigType ( int index, Varjo.CHROMAKEY_TYPE type ) #

Sets a new type for the chroma key configuration with the specified index. Each chroma key configuration index has a config type, which can be used to determine if the slot in the current index is being used. Active configurations have the HSV type.

Arguments

vec3 GetChromaKeyConfigFalloff ( int index ) #

Returns the current tolerance falloff values for HSV components of the chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.

Return value

Current tolerance falloff values for HSV components of the chroma key target color. The range for each component is [0.0; 1.0].

void SetChromaKeyConfigFalloff ( int index, vec3 falloff ) #

Sets new tolerance falloff values for HSV components of the chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.
  • vec3 falloff - New tolerance falloff values to be set for HSV components of the chroma key target color. The range for each component is [0.0; 1.0].

vec3 GetChromaKeyConfigTargetColor ( int index ) #

Returns the current chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.

Return value

Current chroma key target color in HSV colorspace. The range for each component is [0.0; 1.0].

void SetChromaKeyConfigTargetColor ( int index, vec3 target_color ) #

Sets a new chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.
  • vec3 target_color - New chroma key target color to be set in HSV colorspace. The range for each component is [0.0; 1.0].

vec3 GetChromaKeyConfigTolerance ( int index ) #

Returns the current tolerance values for HSV components of the chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.

Return value

Current tolerance values for HSV components of the chroma key target color. The range for each component is [0.0; 1.0].

void SetChromaKeyConfigTolerance ( int index, vec3 tolerance ) #

Sets new tolerance values for HSV components of the chroma key target color.

Arguments

  • int index - Chroma key config index in the range fron 0 to config count - 1.
  • vec3 tolerance - New tolerance values for HSV components of the chroma key target color to be set. The range for each component is [0.0; 1.0].

void SetCameraExposureTimeAuto ( ) #

Enables automatic exposure adjustment mode for the camera.

void SetCameraExposureTimeManual ( ) #

Enables manual exposure adjustment mode for the camera. In this mode you can set the desired exposure time correction value manually via the setCameraExposureTime() method.

bool IsCameraExposureTimeAuto ( ) #

Returns a value indicating if automatic exposure adjustment mode for the camera is enabled.

Return value

true if automatic exposure adjustment mode for the camera is enabled; otherwise - false.

void SetCameraWhiteBalanceAuto ( ) #

Enables automatic white balance adjustment mode for the camera.

void SetCameraWhiteBalanceManual ( ) #

Enables manual white balance adjustment mode for the camera. In this mode you can set the desired white balance correction value manually via the getCameraWhiteBalance() method.

bool IsCameraWhiteBalanceAuto ( ) #

Returns a value indicating if automatic white balance adjustment mode for the camera is enabled.

Return value

true if automatic white balance adjustment mode for the camera is enabled; otherwise - false.

void SetCameraISOAuto ( ) #

Enables automatic ISO adjustment mode for the camera.

void SetCameraISOManual ( ) #

Enables manual ISO adjustment mode for the camera. In this mode you can set the desired ISO value manually via the setCameraISO() method.

bool IsCameraISOAuto ( ) #

Returns a value indicating if automatic ISO adjustment mode for the camera is enabled.

Return value

true if automatic ISO adjustment mode for the camera is enabled; otherwise - false.

void SetMarkerLifetime ( float lifetime, ulong[] marker_ids ) #

Sets a lifetime for markers under specified ids.

Arguments

  • float lifetime - Lifetime to be set.
  • ulong[] marker_ids - Marker ids to receive a new lifetime.

void SetMarkerLifetime ( float lifetime, ulong marker_id ) #

Sets a lifetime for a marker under specified id.

Arguments

  • float lifetime - Lifetime to be set.
  • ulong marker_id - A marker id to receive a new lifetime.

void SetMarkerFlags ( Varjo.MARKER_FLAGS flags, ulong[] marker_ids ) #

Sets the flags for all markers by specified ids.

Arguments

  • Varjo.MARKER_FLAGS flags - New flags to set up.
  • ulong[] marker_ids - Marker ids to receive new flags.

void SetMarkerFlags ( Varjo.MARKER_FLAGS flags, ulong marker_id ) #

Sets the flags for a marker by a specified id.

Arguments

  • Varjo.MARKER_FLAGS flags - New flags to set up.
  • ulong marker_id - Marker id to receive new flags.

MarkerObject GetMarkerObject ( int index ) #

Returns the marker object with the specified marker index.

Arguments

  • int index - Marker index.

Return value

Marker object.

void Render ( Player player, ivec2 size, bool render_window ) #

Arguments

Last update: 2023-08-08
Build: ()