Unigine::Plugins::AppVarjo Class
Header: | #include <plugins/UnigineAppVarjo.h> |
This set of functions is available when the AppVarjo plugin is loaded.
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:
#ifdef HAS_APP_VARJO
// AppVarjo functions
#endif
AppVarjo Class
Enums
EYE_STATUS#
EYETRACKING_STATUS#
CONTROLLER_ROLE#
BUTTON#
Name | Description |
---|---|
BUTTON_SYSTEM = 0 | The system button. These events are not visible to applications and are used internally to bring up the Steam Overlay or the Steam Client. |
BUTTON_APPLICATIONMENU = 1 | The application menu button. |
BUTTON_GRIP = 2 | The grip button. |
BUTTON_DPAD_LEFT = 3 | The sensor panel left button. |
BUTTON_DPAD_UP = 4 | The sensor panel up button. |
BUTTON_DPAD_RIGHT = 5 | The sensor panel right button. |
BUTTON_DPAD_DOWN = 6 | The sensor panel down button. |
BUTTON_A = 7 | The button reserved for manual controllers. |
BUTTON_AXIS0 = 32 | The axis reserved for manual controllers. |
BUTTON_AXIS1 = 33 | The axis reserved for manual controllers. |
BUTTON_AXIS2 = 34 | The axis reserved for manual controllers. |
BUTTON_AXIS3 = 35 | The axis reserved for manual controllers. |
BUTTON_AXIS4 = 36 | The axis reserved for manual controllers. |
BUTTON_STEAMVR_TOUCHPAD = 32 | The touchpad on the SteamVR controller. It is the same as BUTTON_AXIS0. |
BUTTON_STEAMVR_TRIGGER = 33 | The trigger on the SteamVR controller. It is the same as BUTTON_AXIS1. |
BUTTON_DASHBOARD_BACK = 2 | The back to dashboard button. |
BUTTON_MAX = 64 | This is not an actual button. It just indicates the maximum number of buttons in the system. |
AXIS#
Name | Description |
---|---|
AXIS_NONE = 0 | No axis is identified on the controller. |
AXIS_TRACKPAD = 1 | An axis of a trackpad type. |
AXIS_JOYSTICK = 2 | An axis of a joystick type. |
AXIS_TRIGGER = 3 | An axis of a trigger type. |
DEVICE#
VIEWPORT#
Name | Description |
---|---|
VIEWPORT_BLACK_SCREEN = 0 | No image (black screen). |
VIEWPORT_MONO = 1 | Mono image. |
VIEWPORT_STEREO = 2 | Stereo image (left and right eye). |
Members
void setViewportMode ( AppVarjo::VIEWPORT mode ) #
Sets the viewport mode, that determines the type of image to be displayed in the viewport.Arguments
- AppVarjo::VIEWPORT mode - Viewport mode. One of the VIEWPORT variables.
AppVarjo::VIEWPORT 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 VIEWPORT variables.void setHeadPositionLock ( bool lock ) #
Locks the head position.Arguments
- bool lock - true to lock the head position.
void setHeadRotationLock ( bool lock ) #
Locks the head rotation.Arguments
- bool lock - true to lock the head rotation.
bool isHeadPositionLocked ( ) #
Returns the value indicating if the head position is locked.Return value
true if the head position is locked; otherwise - false.bool isHeadRotationLocked ( ) #
Returns the value indicating if the head rotation is locked.Return value
true if the head rotation is locked; otherwise - false.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.Math::mat4 getDevicePose ( int device_num ) #
Returns a single pose for a tracked device.Arguments
- int device_num - Device ID.
Return value
Identity matrix.Math::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.Math::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.AppVarjo::DEVICE getDeviceType ( int device_num ) #
Returns the device type.Arguments
- int device_num - Device ID.
Return value
Device type, one of the DEVICE variables.AppVarjo::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, AppVarjo::BUTTON button ) #
Returns the value indicating if the specified button is pressed.Arguments
- int device_num - Device ID.
- AppVarjo::BUTTON button - A button, one of the BUTTON variables.
Return value
true if the button is pressed; otherwise - false.bool getControllerButtonTouched ( int device_num, AppVarjo::BUTTON button ) #
Returns the value indicating if the specified button is touched.Arguments
- int device_num - Device ID.
- AppVarjo::BUTTON button - A button, one of the BUTTON variables.
Return value
true if the button is pressed; otherwise - false.Math::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, unsigned short duration ) #
Sets the vibration of the given duration and amplitude.Arguments
- int device_num - Device ID.
- unsigned short duration - Duration of the vibration.
bool isEyeTrackingValid ( ) #
Returns the value indicating if eye tracking is valid.Return value
true if eye tracking is valid; otherwise - false.Math::Vec3 getFocusWorldPosition ( ) #
Returns the position of the eye focus point in world coordinates.Return value
World position of the eye focus point.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.Math::Vec3 getLeftEyeWorldPosition ( ) #
Returns the position of the left eye in world coordinates.Return value
World position of the left eye.Math::Vec3 getLeftEyeWorldDirection ( ) #
Returns the direction vector of the left eye in world coordinates.Return value
Direction vector of the left eye.Math::Vec3 getRightEyeWorldPosition ( ) #
Returns the position of the right eye in world coordinates.Return value
World position of the right eye.Math::Vec3 getRightEyeWorldDirection ( ) #
Returns the direction vector of the right eye in world coordinates.Return value
Direction vector of the right eye.Math::Vec3 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 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 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 long getCaptureTime ( ) #
Returns the timestamp of when the data was recorded, in nanoseconds.Return value
Timestamp of when the data was recorded, in nanoseconds.double 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 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.AppVarjo::EYETRACKING_STATUS 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 EYETRACKING_STATUS variables.AppVarjo::EYE_STATUS 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 EYE_STATUS variables.AppVarjo::EYE_STATUS 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 EYE_STATUS variables.long long 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 setVisualizerEnabled ( bool enabled ) #
Toggles visualizer.Arguments
- bool enabled - true to enable visualizer; false to disable it.
bool isVisualizerEnabled ( ) #
Returns the value indicating if visualizer is enabled.Return value
true if visualizer is enabled; otherwise - false.AppVarjo::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.Last update:
2020-07-31
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)