This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
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.

engine.varjo Functions

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

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

Notice
AppVarjo plugin cannot be used in a Qt-based application.

If AppVarjo plugin is loaded together with the engine, the HAS_APP_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_APP_VARJO
	// AppVarjo functions
#endif

AppVarjo Class

Members


void engine.varjo.setViewportMode ( int mode ) #

Sets the viewport mode, that determines the type of image to be displayed in the viewport.

Arguments

int engine.varjo.getViewportMode ( ) #

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

Return value

Current viewport mode. One of the APP_VARJO_VIEWPORT_ variables.

void engine.varjo.setHeadPositionLock ( bool lock ) #

Locks the head position.

Arguments

  • bool lock - true to lock the head position.

void engine.varjo.setHeadRotationLock ( bool lock ) #

Locks the head rotation.

Arguments

  • bool lock - true to lock the head rotation.

bool engine.varjo.isHeadPositionLocked ( ) #

Returns the value indicating if the head position is locked.

Return value

true if the head position is locked; otherwise - false.

bool engine.varjo.isHeadRotationLocked ( ) #

Returns the value indicating if the head rotation is locked.

Return value

true if the head rotation is locked; otherwise - false.

int engine.varjo.getMaxTrackedDeviceCount ( ) #

Returns the maximum value of tracked devices.

Return value

The maximum value of tracked devices.

int engine.varjo.getControllerStateAxisCount ( ) #

Returns a number of axes.

Return value

Number of axes.

mat4 engine.varjo.getDevicePose ( int device_num ) #

Returns a single pose for a tracked device.

Arguments

  • int device_num - Device ID.

Return value

Identity matrix.

vec3 engine.varjo.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 engine.varjo.getDeviceAngularVelocity ( int device_num ) #

Returns a device angular velocity, in radians per second.

Arguments

  • int device_num - Device ID.

Return value

Angular velocity.

bool engine.varjo.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 engine.varjo.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 engine.varjo.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.

int engine.varjo.getDeviceType ( int device_num ) #

Returns the device type.

Arguments

  • int device_num - Device ID.

Return value

Device type, one of the APP_VARJO_DEVICE_ variables.

int engine.varjo.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 APP_VARJO_AXIS_ variables.

int engine.varjo.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 engine.varjo.getControllerButtonPressed ( int device_num, int button ) #

Returns the value indicating if the specified button is pressed.

Arguments

  • int device_num - Device ID.
  • int button - A button, one of the APP_VARJO_BUTTON_ variables.

Return value

true if the button is pressed; otherwise - false.

bool engine.varjo.getControllerButtonTouched ( int device_num, int button ) #

Returns the value indicating if the specified button is touched.

Arguments

  • int device_num - Device ID.
  • int button - A button, one of the APP_VARJO_BUTTON_ variables.

Return value

true if the button is pressed; otherwise - false.

vec2 engine.varjo.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 engine.varjo.setControllerVibration ( int device_num, int duration ) #

Sets the vibration of the given duration and amplitude.

Arguments

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

bool engine.varjo.isEyeTrackingValid ( ) #

Returns the value indicating if eye tracking is valid.

Return value

true if eye tracking is valid; otherwise - false.

Vec3 engine.varjo.getFocusWorldPosition ( ) #

Returns the position of the eye focus point in world coordinates.

Return value

World position of the eye focus point.

void engine.varjo.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.

Vec3 engine.varjo.getLeftEyeWorldPosition ( ) #

Returns the position of the left eye in world coordinates.

Return value

World position of the left eye.

Vec3 engine.varjo.getLeftEyeWorldDirection ( ) #

Returns the direction vector of the left eye in world coordinates.

Return value

Direction vector of the left eye.

Vec3 engine.varjo.getRightEyeWorldPosition ( ) #

Returns the position of the right eye in world coordinates.

Return value

World position of the right eye.

Vec3 engine.varjo.getRightEyeWorldDirection ( ) #

Returns the direction vector of the right eye in world coordinates.

Return value

Direction vector of the right eye.

Vec3 engine.varjo.getGazeWorldDirection ( ) #

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

Return value

Direction vector for both eyes.

double engine.varjo.getLeftEyePupilSize ( ) #

Returns 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.

Return value

The size of the left eye pupil, the value between 0 and 1.

double engine.varjo.getRightEyePupilSize ( ) #

Returns 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.

Return value

The size of the right eye pupil, the value between 0 and 1.

long engine.varjo.getCaptureTime ( ) #

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

Return value

Timestamp of when the data was recorded, in nanoseconds.

double engine.varjo.getFocusDistance ( ) #

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

Return value

The distance between the eye and the focus point.

double engine.varjo.getStability ( ) #

Returns a 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.

Return value

A 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.

int engine.varjo.getEyeTrackingStatus ( ) #

Returns a value representing the status of eye tracking in the Varjo headsets.

Return value

Value representing the status of eye tracking in the Varjo headsets, one of the APP_VARJO_EYETRACKING_STATUS_ variables.

int engine.varjo.getLeftEyeStatus ( ) #

Returns a value representing the tracking status for the left eye.

Return value

Value representing the tracking status for the left eye, one of the APP_VARJO_EYE_STATUS_ variables.

int engine.varjo.getRightEyeStatus ( ) #

Returns a value representing the tracking status for the right eye.

Return value

Value representing the tracking status for the right eye, one of the APP_VARJO_EYE_STATUS_ variables.

long engine.varjo.getFrameNum ( ) #

Returns a unique identifier of the frame when the data was recorded.

Return value

Unique identifier of the frame when the data was recorded.

void engine.varjo.setVisualizerEnabled ( bool enabled ) #

Toggles visualizer.

Arguments

  • bool enabled - true to enable visualizer; false to disable it.

bool engine.varjo.isVisualizerEnabled ( ) #

Returns the value indicating if visualizer is enabled.

Return value

true if visualizer is enabled; otherwise - false.

int engine.varjo.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 APP_VARJO_CONTROLLER_ROLE_ variables.
Last update: 2020-07-31
Build: ()