Varjo Class
Enums
EYE_STATUS#
Name | Description |
---|
INVALID = 0 | Eye is not tracked and not visible (for example, eye is shut). |
VISIBLE = 1 | Eye is visible but not reliably tracked (for example, saccade or blink). |
COMPENSATED = 2 | Eye is tracked but quality compromised (for example, headset has moved after calibration). |
TRACKED = 3 | Eye is tracked. |
EYETRACKING_STATUS#
Name | Description |
---|
INVALID = 0 | Data is not available, user is not wearing the device or eyes cannot be found. |
ADJUST = 1 | User is wearing the device, but gaze tracking is being calibrated. |
VALID = 2 | Data is valid. |
CONTROLLER_ROLE#
Name | Description |
---|
INVALID = 0 | Invalid value for controller type. |
LEFT_HAND = 1 | Tracked device is associated with the left hand. |
RIGHT_HAND = 2 | Tracked device is associated with the right hand. |
OPT_OUT = 3 | Tracked device is opting out of left/right hand. |
TREADMILL = 4 | Tracked device is a treadmill. |
MAX = 5 | Indicates the maximum number of controller roles. |
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#
Name | Description |
---|
INVALID = 0 | A tracked device with an invalid index. |
HMD = 1 | A tracked head-mounted display. |
CONTROLLER = 2 | A tracked controller. |
GENERIC_TRACKER = 3 | A tracked tracker device. |
TRACKING = 4 | A tracked camera and base stations that serve as tracking reference points. |
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#
Name | Description |
---|
TRACING_OK = 0x1 | Pose is being currently tracked. |
TRACING_LOST = 0x2 | Pose has been tracked but currently is not detected by the tracking subsystem. |
TRACING_DISCONNECTED = 0x4 | Tracking subsystem is not connected and poses cannot be acquired. |
HAS_POSITION = 0x8 | Pose has position information. |
HAS_ROTATION = 0x10 | Pose has rotation information. |
HAS_VELOCITY = 0x20 | Pose has velocity information. |
HAS_ANGULAR_VELOCITY = 0x40 | Pose has angular velocity information. |
HAS_ACCELERATION = 0x80 | Pose has acceleration information. |
HAS_CONFIDENCE = 0x100 | Pose has confidence information. |
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.
Name | Description |
---|
VR_1 = 0 | Varjo VR-1 head-mounted display. |
XR_1 = 1 | Varjo XR-1 head-mounted display. |
VR_2 = 2 | Varjo VR-2 head-mounted display. |
VR_2_PRO = 3 | Varjo VR-2 Pro head-mounted display. |
VR_3 = 4 | Varjo VR-3 head-mounted display. |
XR_3 = 5 | Varjo XR-3 head-mounted display. |
AERO = 6 | Varjo Aero head-mounted display. |
UNKNOWN = 7 | Unknown head-mounted display. |
BLEND_MASKING_MODE#
Name | Description |
---|
DISABLED = 0 | Masking mode is disabled. |
RESTRICT_VIDEO_TO_MASK = 1 | Show the video pass-through image (VST) in the mask. Can be used with chroma key. |
RESTRICT_VR_TO_MASK = 2 | Show VR in the mask. Can be used with chroma key. |
RESTRICT_VR_TO_CHROMAKEY_REDUCED_BY_MASK = 3 | Show VR in the mask and chroma elsewhere. Requires chroma key. |
CAMERA_FLICKER_COMPENSATION#
Name | Description |
---|
BEGIN = 0 | The first element to be used for iteration. |
_50_HZ = 0 | The camera flicker compensation value equal to 50 Hz. |
_60_HZ = 1 | The camera flicker compensation value equal to 60 Hz. |
END = 1 | The last element to be used for iteration. |
CAMERA_ISO#
Name | Description |
---|
BEGIN = 0 | The first element to be used for iteration. |
_100 = 0 | The camera ISO value equal to 100. |
_200 = 1 | The camera ISO value equal to 200. |
_400 = 2 | The camera ISO value equal to 400. |
_800 = 3 | The camera ISO value equal to 800. |
_1600 = 4 | The camera ISO value equal to 1600. |
_3200 = 5 | The camera ISO value equal to 3200. |
_6400 = 6 | The camera ISO value equal to 6400. |
END = 6 | The last element to be used for iteration. |
CAMERA_WHITE_BALANCE#
Name | Description |
---|
BEGIN = 0 | The first element to be used for iteration. |
_2000_K = 0 | The camera white balance value equal to 2000 K. |
_3000_K = 1 | The camera white balance value equal to 3000 K. |
_3500_K = 2 | The camera white balance value equal to 3500 K. |
_4200_K = 3 | The camera white balance value equal to 4200 K. |
_5000_K = 4 | The camera white balance value equal to 5000 K. |
_5400_K = 5 | The camera white balance value equal to 5400 K. |
_6500_K = 6 | The camera white balance value equal to 6500 K. |
_8000_K = 7 | The camera white balance value equal to 8000 K. |
_12000_K = 8 | The camera white balance value equal to 12000 K. |
END = 8 | The last element to be used for iteration. |
CAMERA_EXPOSURE_TIME#
Name | Description |
---|
BEGIN = 0 | The first element to be used for iteration. |
_91_MS = 0 | The camera exposure time value equal to 91 K. |
_125_MS = 1 | The camera exposure time value equal to 125 K. |
_250_MS = 2 | The camera exposure time value equal to 250 K. |
_500_MS = 3 | The camera exposure time value equal to 500 K. |
_1000_MS = 4 | The camera exposure time value equal to 1000 K. |
_2000_MS = 5 | The camera exposure time value equal to 2000 K. |
_4000_MS = 6 | The camera exposure time value equal to 4000 K. |
_8000_MS = 7 | The camera exposure time value equal to 8000 K. |
END = 7 | The last element to be used for iteration. |
Properties
bool VisualizerEnabled#
The value indicating if visualizer is enabled.
long FrameNum#
The unique identifier of the frame when the data was recorded.
The value representing the tracking status for the right eye.
The value representing the tracking status for the left eye.
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, in Hz (e.g "50" -> compensation for 50 Hz).
int CameraISO#
The ISO value for the camera (e.g., "200" -> ISO200).
int CameraWhiteBalance#
The white balance correction value for the camera, in Kelvin.
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 mode defining the way the AR texture is set for the environment.
double ViewOffset#
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 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.
The 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.
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 value indicating if support for Motion Prediction is enabled.
bool BlendMaskingDebugEnabled#
The value indicating if blend masking debug visualization is enabled.
bool StreamColorCorrectionWhiteBalanceEnabled#
The value indicating if white balance correction for the stream is enabled.
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.
int CameraMaxSharpness#
int CameraMinSharpness#
int[]
CameraSupportedFlickerCompensations#
The vector containing the supported flicker compensation values for the connected device.
int[]
CameraSupportedISO#
The vector containing the supported ISO values for the connected device.
int[]
CameraSupportedWhiteBalances#
The vector containing the supported white balance values for the connected device.
double[]
CameraSupportedExposureTimes#
The vector containing the valid exposure time values for the connected device.
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.
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
Return value
Manufacturer name.
string GetDeviceModelNumber
(
int device
)
#
Returns the model number of the specified device.
Arguments
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.
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].
Sets an exposure time value that is valid for the connected device.
Arguments
double[]
GetCameraSupportedExposureTimes
(
)
#
Returns a vector containing the exposure time values that are set as valid for the connected device.
Return value
The vector containing the valid exposure time values for the connected device.
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.
Sets a white balance correction value that is valid for the connected device.
Arguments
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.
int[]
GetCameraSupportedWhiteBalances
(
)
#
Returns a vector containing the white balance values that are set as valid for the connected device.
Return value
The vector containing the supported white balance values for the connected device.
Sets a new ISO value that is valid for the connected device.
Arguments
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.
int[]
GetCameraSupportedISO
(
)
#
Returns a vector containing the ISO values that are set as valid for the connected device.
Return value
The vector containing the supported ISO values for the connected device.
Sets a new flicker compensation value for the camera. This is useful when using the HMD indoors with mostly artificial light bulbs, which flicker at the frequency of 50Hz or 60Hz and can cause visual flicker artifacts on the video see through image. The correct setting depends on the underlying power grid's frequency. e.g. In most parts of Africa/Asia/Australia/Europe the frequency is 50 Hz and in most parts of North and South America 60 Hz.
Arguments
int[]
GetCameraSupportedFlickerCompensations
(
)
#
Returns a vector containing the flicker compensation values that are set as valid for the connected device.
Return value
The vector containing the supported flicker compensation values for the connected device.
int GetCameraMinSharpness
(
)
#
Returns the minimum possible value for the
camera sharpness.
Return value
The minimum possible value for the
camera sharpness.
int GetCameraMaxSharpness
(
)
#
Returns the maximum possible value for the
camera sharpness.
Return value
The maximum possible value for the
camera sharpness.
void SetMarkerLifetime
(
float lifetime, ulong[]
OUT_marker_ids
)
#
Sets a lifetime for markers under specified ids.
Arguments
- float lifetime - Lifetime to be set.
- ulong[]
OUT_marker_ids - Marker ids to receive a new lifetime.
NoticeThis output buffer is to be filled by the Engine as a result of executing the method.
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[]
OUT_marker_ids
)
#
Sets the flags for all markers by specified ids.
Arguments
- Varjo.MARKER_FLAGS flags - New flags to set up.
- ulong[]
OUT_marker_ids - Marker ids to receive new flags.
NoticeThis output buffer is to be filled by the Engine as a result of executing the method.
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
)
#
Calls Varjo rendering logic.
Arguments
- Player player - The player camera.
- ivec2 size - The window size, in pixels.
- bool render_window - true to enable rendering of a copy to the current render target window; false — to disable it.