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#
EYETRACKING_STATUS#
CONTROLLER_ROLE#
BUTTON#
Name | Description |
---|---|
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. |
APPLICATIONMENU = 1 | The application menu button. |
GRIP = 2 | The grip button. |
DPAD_LEFT = 3 | The sensor panel left button. |
DPAD_UP = 4 | The sensor panel up button. |
DPAD_RIGHT = 5 | The sensor panel right button. |
DPAD_DOWN = 6 | The sensor panel down button. |
A = 7 | The button reserved for manual controllers. |
AXIS0 = 32 | The axis reserved for manual controllers. |
AXIS1 = 33 | The axis reserved for manual controllers. |
AXIS2 = 34 | The axis reserved for manual controllers. |
AXIS3 = 35 | The axis reserved for manual controllers. |
AXIS4 = 36 | The axis reserved for manual controllers. |
STEAMVR_TOUCHPAD = 32 | The touchpad on the SteamVR controller. It is the same as BUTTON_AXIS0. |
STEAMVR_TRIGGER = 33 | The trigger on the SteamVR controller. It is the same as BUTTON_AXIS1. |
DASHBOARD_BACK = 2 | The back to dashboard button. |
MAX = 64 | This is not an actual button. It just indicates the maximum number of buttons in the system. |
AXIS#
Name | Description |
---|---|
NONE = 0 | No axis is identified on the controller. |
TRACKPAD = 1 | An axis of a trackpad type. |
JOYSTICK = 2 | An axis of a joystick type. |
TRIGGER = 3 | An axis of a trigger type. |
DEVICE#
VIEWPORT#
Name | Description |
---|---|
BLACK_SCREEN = 0 | No image (black screen). |
MONO = 1 | Mono image. |
STEREO = 2 | Stereo 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.Name | Description |
---|---|
DISABLED = 0 | Disabled chroma key config. |
HSV = 1 | HSV chroma key config. |
MARKER_POSE_FLAGS#
MARKER_FLAGS#
Name | Description |
---|---|
DO_PREDICTION = 0x1 | Marker pose is predicted. If not specified, the latest detected pose is used. |
ENVIRONMENT_MODE#
Name | Description |
---|---|
PRESET = 0 | Environment mode that sets the cubemap defining the color for the environment preset that retains the sky color, haze, etc. |
OVERLAP = 1 | Environment mode that sets the environment texture substituting the sky. |
HMD_TYPE#
Head-mounted display type.BLEND_MASKING_MODE#
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
- int device_num - Device ID.
- Varjo.BUTTON button - A button, one of the BUTTON variables.
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
- int device_num - Device ID.
- Varjo.BUTTON button - A button, one of the BUTTON variables.
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
- int index - Chroma key config index in the range fron 0 to config count - 1.
- Varjo.CHROMAKEY_TYPE type - New chroma key configuration type to be set.
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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)