This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::Plugins::Varjo Class

Header: #include <plugins/Unigine/Varjo/UnigineVarjo.h>

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

MarkerObject Structure#

Varjo markers are typically used in mixed reality applications, but can be also used without video pass-through rendering in virtual reality applications to align virtual objects in the scene with physical objects in the real world. Object markers are used to track static or dynamic objects in the user environment. You can use the object markers in both XR and VR applications. Each marker has a unique ID, and you shouldn't use the same marker more than once in any given environment. For added precision, an application can use multiple markers to track a single object. You can, for example, track a monitor by placing a marker in each corner.

This structure represents a Varjo object marker and has the following set of properties:

Math::Mat4 transform Marker pose transformation in global space.
Math::Vec3 size Size of the marker in meters.
Math::Vec3 velocity Linear velocity (m/s).
Math::Vec3 angular_velocity Angular velocity (radians/s).
Math::Vec3 acceleration Acceleration (m/s 2).
int timestamp Timestamp of the pose, in nanoseconds. This represents the time the pose has been extrapolated to.
double confidence Tracker confidence in range [0.0, 1.0].
Varjo::MARKER_POSE_FLAGS pose_flags Bit field value describing pose.
Varjo::MARKER_FLAGS flags Marker flags.
int id Unique id of the marker object.

Varjo Class

枚举

EYE_STATUS#

Name描述
EYE_STATUS_INVALID = 0Eye is not tracked and not visible (for example, eye is shut).
EYE_STATUS_VISIBLE = 1Eye is visible but not reliably tracked (for example, saccade or blink).
EYE_STATUS_COMPENSATED = 2Eye is tracked but quality compromised (for example, headset has moved after calibration).
EYE_STATUS_TRACKED = 3Eye is tracked.

EYETRACKING_STATUS#

Name描述
EYETRACKING_STATUS_INVALID = 0Data is not available, user is not wearing the device or eyes cannot be found.
EYETRACKING_STATUS_ADJUST = 1User is wearing the device, but gaze tracking is being calibrated.
EYETRACKING_STATUS_VALID = 2Data is valid.

CONTROLLER_ROLE#

Name描述
CONTROLLER_ROLE_INVALID = 0Invalid value for controller type.
CONTROLLER_ROLE_LEFT_HAND = 1Tracked device is associated with the left hand.
CONTROLLER_ROLE_RIGHT_HAND = 2Tracked device is associated with the right hand.
CONTROLLER_ROLE_OPT_OUT = 3Tracked device is opting out of left/right hand.
CONTROLLER_ROLE_TREADMILL = 4Tracked device is a treadmill.
CONTROLLER_ROLE_MAX = 5Indicates the maximum number of controller roles.

BUTTON#

Name描述
BUTTON_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.
BUTTON_APPLICATIONMENU = 1The application menu button.
BUTTON_GRIP = 2The grip button.
BUTTON_DPAD_LEFT = 3The sensor panel left button.
BUTTON_DPAD_UP = 4The sensor panel up button.
BUTTON_DPAD_RIGHT = 5The sensor panel right button.
BUTTON_DPAD_DOWN = 6The sensor panel down button.
BUTTON_A = 7The button reserved for manual controllers.
BUTTON_AXIS0 = 32The axis reserved for manual controllers.
BUTTON_AXIS1 = 33The axis reserved for manual controllers.
BUTTON_AXIS2 = 34The axis reserved for manual controllers.
BUTTON_AXIS3 = 35The axis reserved for manual controllers.
BUTTON_AXIS4 = 36The axis reserved for manual controllers.
BUTTON_STEAMVR_TOUCHPAD = 32The touchpad on the SteamVR controller. It is the same as BUTTON_AXIS0.
BUTTON_STEAMVR_TRIGGER = 33The trigger on the SteamVR controller. It is the same as BUTTON_AXIS1.
BUTTON_DASHBOARD_BACK = 2The back to dashboard button.
BUTTON_MAX = 64This is not an actual button. It just indicates the maximum number of buttons in the system.

AXIS#

Name描述
AXIS_NONE = 0No axis is identified on the controller.
AXIS_TRACKPAD = 1An axis of a trackpad type.
AXIS_JOYSTICK = 2An axis of a joystick type.
AXIS_TRIGGER = 3An axis of a trigger type.

DEVICE#

Name描述
DEVICE_INVALID = 0A tracked device with an invalid index.
DEVICE_HMD = 1A tracked head-mounted display.
DEVICE_CONTROLLER = 2A tracked controller.
DEVICE_GENERIC_TRACKER = 3A tracked tracker device.
DEVICE_TRACKING = 4A tracked camera and base stations that serve as tracking reference points.

VIEWPORT#

Name描述
VIEWPORT_BLACK_SCREEN = 0No image (black screen).
VIEWPORT_MONO = 1Mono image.
VIEWPORT_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.
Name描述
CHROMAKEY_TYPE_DISABLED = 0Disabled chroma key config.
CHROMAKEY_TYPE_HSV = 1HSV chroma key config.

MARKER_POSE_FLAGS#

Name描述
MARKER_POSE_FLAGS_TRACING_OK = 0x1Pose is being currently tracked.
MARKER_POSE_FLAGS_TRACING_LOST = 0x2Pose has been tracked but currently is not detected by the tracking subsystem.
MARKER_POSE_FLAGS_TRACING_DISCONNECTED = 0x4Tracking subsystem is not connected and poses cannot be acquired.
MARKER_POSE_FLAGS_HAS_POSITION = 0x8Pose has position information.
MARKER_POSE_FLAGS_HAS_ROTATION = 0x10Pose has rotation information.
MARKER_POSE_FLAGS_HAS_VELOCITY = 0x20Pose has velocity information.
MARKER_POSE_FLAGS_HAS_ANGULAR_VELOCITY = 0x40Pose has angular velocity information.
MARKER_POSE_FLAGS_HAS_ACCELERATION = 0x80Pose has acceleration information.
MARKER_POSE_FLAGS_HAS_CONFIDENCE = 0x100Pose has confidence information.

MARKER_FLAGS#

Name描述
MARKER_FLAGS_DO_PREDICTION = 0x1Marker pose is predicted. If not specified, the latest detected pose is used.

ENVIRONMENT_MODE#

Name描述
ENVIRONMENT_MODE_PRESET = 0Environment mode that sets the cubemap defining the color for the environment preset that retains the sky color, haze, etc.
ENVIRONMENT_MODE_OVERLAP = 1Environment mode that sets the environment texture substituting the sky.

HMD_TYPE#

Head-mounted display type.
Name描述
HMD_TYPE_VR_1 = 0Varjo VR-1 head-mounted display.
HMD_TYPE_XR_1 = 1Varjo XR-1 head-mounted display.
HMD_TYPE_VR_2 = 2Varjo VR-2 head-mounted display.
HMD_TYPE_VR_2_PRO = 3Varjo VR-2 Pro head-mounted display.
HMD_TYPE_VR_3 = 4Varjo VR-3 head-mounted display.
HMD_TYPE_XR_3 = 5Varjo XR-3 head-mounted display.
HMD_TYPE_AERO = 6Varjo Aero head-mounted display.
HMD_TYPE_UNKNOWN = 7Unknown head-mounted display.

BLEND_MASKING_MODE#

Name描述
BLEND_MASKING_MODE_DISABLED = 0Masking mode is disabled.
BLEND_MASKING_MODE_RESTRICT_VIDEO_TO_MASK = 1Show the video pass-through image (VST) in the mask. Can be used with chroma key.
BLEND_MASKING_MODE_RESTRICT_VR_TO_MASK = 2Show VR in the mask. Can be used with chroma key.
BLEND_MASKING_MODE_RESTRICT_VR_TO_CHROMAKEY_REDUCED_BY_MASK = 3Show VR in the mask and chroma elsewhere. Requires chroma key.

CAMERA_FLICKER_COMPENSATION#

Name描述
CAMERA_FLICKER_COMPENSATION_BEGIN = 0The first element to be used for iteration.
CAMERA_FLICKER_COMPENSATION__50_HZ = 0The camera flicker compensation value equal to 50 Hz.
CAMERA_FLICKER_COMPENSATION__60_HZ = 1The camera flicker compensation value equal to 60 Hz.
CAMERA_FLICKER_COMPENSATION_END = 1The last element to be used for iteration.

CAMERA_ISO#

Name描述
CAMERA_ISO_BEGIN = 0The first element to be used for iteration.
CAMERA_ISO__100 = 0The camera ISO value equal to 100.
CAMERA_ISO__200 = 1The camera ISO value equal to 200.
CAMERA_ISO__400 = 2The camera ISO value equal to 400.
CAMERA_ISO__800 = 3The camera ISO value equal to 800.
CAMERA_ISO__1600 = 4The camera ISO value equal to 1600.
CAMERA_ISO__3200 = 5The camera ISO value equal to 3200.
CAMERA_ISO__6400 = 6The camera ISO value equal to 6400.
CAMERA_ISO_END = 6The last element to be used for iteration.

CAMERA_WHITE_BALANCE#

Name描述
CAMERA_WHITE_BALANCE_BEGIN = 0The first element to be used for iteration.
CAMERA_WHITE_BALANCE__2000_K = 0The camera white balance value equal to 2000 K.
CAMERA_WHITE_BALANCE__3000_K = 1The camera white balance value equal to 3000 K.
CAMERA_WHITE_BALANCE__3500_K = 2The camera white balance value equal to 3500 K.
CAMERA_WHITE_BALANCE__4200_K = 3The camera white balance value equal to 4200 K.
CAMERA_WHITE_BALANCE__5000_K = 4The camera white balance value equal to 5000 K.
CAMERA_WHITE_BALANCE__5400_K = 5The camera white balance value equal to 5400 K.
CAMERA_WHITE_BALANCE__6500_K = 6The camera white balance value equal to 6500 K.
CAMERA_WHITE_BALANCE__8000_K = 7The camera white balance value equal to 8000 K.
CAMERA_WHITE_BALANCE__12000_K = 8The camera white balance value equal to 12000 K.
CAMERA_WHITE_BALANCE_END = 8The last element to be used for iteration.

CAMERA_EXPOSURE_TIME#

Name描述
CAMERA_EXPOSURE_TIME_BEGIN = 0The first element to be used for iteration.
CAMERA_EXPOSURE_TIME__91_MS = 0The camera exposure time value equal to 91 K.
CAMERA_EXPOSURE_TIME__125_MS = 1The camera exposure time value equal to 125 K.
CAMERA_EXPOSURE_TIME__250_MS = 2The camera exposure time value equal to 250 K.
CAMERA_EXPOSURE_TIME__500_MS = 3The camera exposure time value equal to 500 K.
CAMERA_EXPOSURE_TIME__1000_MS = 4The camera exposure time value equal to 1000 K.
CAMERA_EXPOSURE_TIME__2000_MS = 5The camera exposure time value equal to 2000 K.
CAMERA_EXPOSURE_TIME__4000_MS = 6The camera exposure time value equal to 4000 K.
CAMERA_EXPOSURE_TIME__8000_MS = 7The camera exposure time value equal to 8000 K.
CAMERA_EXPOSURE_TIME_END = 7The last element to be used for iteration.

Members


void setViewportMode ( Varjo::VIEWPORT mode ) #

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

Arguments

Varjo::VIEWPORT getViewportMode ( ) const#

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.

bool isHeadPositionLock ( ) const#

Returns the value indicating if the head position is locked.

Return value

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

void setHeadRotationLock ( bool lock ) #

Locks the head rotation.

Arguments

  • bool lock - true to lock the head rotation.

bool isHeadRotationLock ( ) const#

Returns the value indicating if the head rotation is locked.

Return value

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

int getMaxTrackedDeviceCount ( ) const#

Returns the maximum value of tracked devices.

Return value

The maximum value of tracked devices.

int getControllerStateAxisCount ( ) const#

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.

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.

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 ( ) const#

Returns the value indicating if eye tracking is valid.

Return value

true if eye tracking is valid; otherwise - false.

Math::Vec3 getFocusWorldPosition ( ) const#

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 ( ) const#

Returns the position of the left eye in world coordinates.

Return value

World position of the left eye.

Math::Vec3 getLeftEyeWorldDirection ( ) const#

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

Return value

Direction vector of the left eye.

Math::Vec3 getRightEyeWorldPosition ( ) const#

Returns the position of the right eye in world coordinates.

Return value

World position of the right eye.

Math::Vec3 getRightEyeWorldDirection ( ) const#

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

Return value

Direction vector of the right eye.

Math::Vec3 getGazeWorldDirection ( ) const#

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 ( ) const#

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 ( ) const#

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 ( ) const#

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

Return value

Timestamp of when the data was recorded, in nanoseconds.

double getFocusDistance ( ) const#

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 ( ) const#

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.

Varjo::EYETRACKING_STATUS getEyeTrackingStatus ( ) const#

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.

Varjo::EYE_STATUS getLeftEyeStatus ( ) const#

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.

Varjo::EYE_STATUS getRightEyeStatus ( ) const#

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 ( ) const#

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 ( ) const#

Returns the value indicating if visualizer is enabled.

Return value

true if visualizer is enabled; otherwise - false.

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.

bool isMixedRealityAvailable ( ) const#

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

Return value

Flag: true if mixed reality mode is available; otherwise - false.

void setFoveatedRenderingEnabled ( bool enabled ) #

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

Arguments

  • bool enabled - Set true to enable foveated rendering; or false - to disable it.

bool isFoveatedRenderingEnabled ( ) const#

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

Return value

Flag: true if foveated rendering is enabled; otherwise - false.

void setAlphaBlend ( bool blend ) #

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

Arguments

  • bool blend - Set true to enable alpha blending; or false - to disable it.

bool isAlphaBlend ( ) const#

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

Return value

Flag: true if alpha blending is enabled; otherwise - false.

void setAlphaInvert ( bool invert ) #

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

Arguments

  • bool invert - Set true to use inverted alpha channel inversion; or false - to use alpha channel as is.

bool isAlphaInvert ( ) const#

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

Return value

Flag: true if alpha channel inversion is enabled; otherwise - false.

void setVideo ( bool video ) #

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

Arguments

  • bool video - Set true to enable the real-world view from the front-facing HMD-mounted cameras; or false - to disable it (VR-only mode).

bool isVideo ( ) const#

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

Return value

Flag: true if real-world view from the front-facing HMD-mounted cameras is enabled; otherwise - false (VR-only mode).

void setDepthTest ( bool test ) #

Sets a value indicating if depth testing is enabled.

Arguments

  • bool test - Set true to enable depth testing; or false - to disable it.

bool isDepthTest ( ) const#

Returns a value indicating if depth testing is enabled.

Return value

Flag: true if depth testing is enabled; otherwise - false.

void setDepthTestRangeEnabled ( bool enabled ) #

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

Arguments

  • bool enabled - Set true to enable depth testing range; or false - to disable it.

bool isDepthTestRangeEnabled ( ) const#

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

Return value

Flag: true if depth testing range is enabled; otherwise - false.

void setDepthTestRange ( const Math::dvec2 & range ) #

Sets a new depth testing range as a two-component vector.

Arguments

  • const Math::dvec2 & range - New depth testing range to be set: ( Depth Test Near Z, Depth Test Far Z). The range for each component in meters is [0.0, 50.0]. The default depth test range is set to [0.0, 1.0].

Math::dvec2 getDepthTestRange ( ) const#

Returns the current depth testing range as a two-component vector.

Return value

Current depth testing range: ( Depth Test Near Z, Depth Test Far Z). The range for each component in meters is [0.0, 50.0]. The default depth test range is set to [0.0, 1.0].

void setChromaKey ( bool key ) #

Sets a value indicating if chroma keying is enabled. Chroma keying is a video technique where a predefined color is replaced with virtual content. Usually the color to be replaced is bright green or bright blue, as those colors contrast the most with human skin.

Arguments

  • bool key - Set true to enable chroma keying; or false - to disable it.

bool isChromaKey ( ) const#

Returns a value indicating if chroma keying is enabled.

Return value

Flag: true if chroma keying is enabled; otherwise - false.

int getChromaKeyConfigNum ( ) const#

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

Return value

Number of supported chroma key configs.

void chromaKeyConfigSubmit ( int index ) const#

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 ) const#

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

Math::vec3 getChromaKeyConfigFalloff ( int index ) const#

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, const Math::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.
  • const Math::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].

Math::vec3 getChromaKeyConfigTargetColor ( int index ) const#

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, const Math::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.
  • const Math::vec3 & target_color - New chroma key target color to be set in HSV colorspace. The range for each component is [0.0; 1.0].

Math::vec3 getChromaKeyConfigTolerance ( int index ) const#

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, const Math::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.
  • const Math::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 setCameraExposureTime ( Varjo::CAMERA_EXPOSURE_TIME value ) #

Sets an exposure time value that is valid for the connected device.

Arguments

Vector<double> getCameraSupportedExposureTimes ( ) const#

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 setCameraExposureTime ( double time ) #

Sets a new exposure time value for the camera.

Arguments

  • double time - New exposure time to be set, in frames per second (e.g. 90.0 -> ~11ms).

double getCameraExposureTime ( ) const#

Returns the current exposure time for the camera.

Return value

Current exposure time, in frames per second (e.g. 90.0 -> ~11ms).

void setCameraExposureTimeAuto ( ) const#

Enables automatic exposure adjustment mode for the camera.

void setCameraExposureTimeManual ( ) const#

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 ( ) const#

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 setCameraWhiteBalance ( Varjo::CAMERA_WHITE_BALANCE balance ) #

Sets a white balance correction value that is valid for the connected device.

Arguments

void setCameraWhiteBalance ( int balance ) #

Sets a white balance correction value that is valid for the connected device.

Arguments

  • int balance - New color temperature value to be set.

int getCameraWhiteBalance ( ) const#

Returns the current white balance correction value for the camera.

Return value

Current color temperature value.

void setCameraWhiteBalanceAuto ( ) const#

Enables automatic white balance adjustment mode for the camera.

void setCameraWhiteBalanceManual ( ) const#

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 ( ) const#

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.

Vector<int> getCameraSupportedWhiteBalances ( ) const#

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.

void setCameraISO ( Varjo::CAMERA_ISO cameraiso ) #

Sets a new ISO value that is valid for the connected device.

Arguments

void setCameraISO ( int cameraiso ) #

Sets a new ISO value that is valid for the connected device.

Arguments

  • int cameraiso - New ISO value to be set (e.g., "200" -> ISO200).

int getCameraISO ( ) const#

Returns the current ISO value for the camera.

Return value

Current ISO value set for the camera (e.g., "200" -> ISO200).

void setCameraISOAuto ( ) const#

Enables automatic ISO adjustment mode for the camera.

void setCameraISOManual ( ) const#

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 ( ) const#

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.

Vector<int> getCameraSupportedISO ( ) const#

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.

void setCameraFlickerCompensation ( Varjo::CAMERA_FLICKER_COMPENSATION compensation ) #

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

void setCameraFlickerCompensation ( int compensation ) #

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 compensation - Flicker compensation value, in Hz.

int getCameraFlickerCompensation ( ) const#

Returns the current flicker compensation value for the camera. One of the CAMERA_FLICKER_COMPENSATION values.

Return value

Current flicker compensation value, in Hz.

Vector<int> getCameraSupportedFlickerCompensations ( ) const#

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.

void setCameraSharpness ( int sharpness ) #

Sets a new sharpness filter power value for the camera.

Arguments

  • int sharpness - New sharpness filter power value to be set: lowest value corresponds to small amount of filtering and the highest value corresponds to the largest amount of filtering.

int getCameraSharpness ( ) const#

Returns the current sharpness filter power value for the camera.

Return value

Current sharpness filter power value: lowest value corresponds to small amount of filtering and the highest value corresponds to the largest amount of filtering.

int getCameraMinSharpness ( ) const#

Returns the minimum possible value for the camera sharpness.

Return value

The minimum possible value for the camera sharpness.

int getCameraMaxSharpness ( ) const#

Returns the maximum possible value for the camera sharpness.

Return value

The maximum possible value for the camera sharpness.

void setMarkerTrackingEnabled ( bool enabled ) #

Sets a value indicating if marker tracking is enabled.

Arguments

  • bool enabled - Set true to enable marker tracking; or false - to disable it.

bool isMarkerTrackingEnabled ( ) const#

Returns a value indicating if marker tracking is enabled.

void setMarkerLifetime ( float lifetime, Vector<unsigned long long> & OUT_marker_ids ) #

Sets a lifetime for markers under specified ids.

Arguments

  • float lifetime - Lifetime to be set.
  • Vector<unsigned long long> & OUT_marker_ids - Marker ids to receive a new lifetime.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.

void setMarkerLifetime ( float lifetime, unsigned long long marker_id ) #

Sets a lifetime for a marker under specified id.

Arguments

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

void setMarkerFlags ( Varjo::MARKER_FLAGS flags, Vector<unsigned long long> & OUT_marker_ids ) #

Sets the flags for all markers by specified ids.

Arguments

  • Varjo::MARKER_FLAGS flags - New flags to set up.
  • Vector<unsigned long long> & OUT_marker_ids - Marker ids to receive new flags.
    Notice
    This output buffer is to be filled by the Engine as a result of executing the method.

void setMarkerFlags ( Varjo::MARKER_FLAGS flags, unsigned long long marker_id ) #

Sets the flags for a marker by a specified id.

Arguments

  • Varjo::MARKER_FLAGS flags - New flags to set up.
  • unsigned long long marker_id - Marker id to receive new flags.

int getMarkerObjectNum ( ) const#

Returns the number of visible marker objects.

Varjo::MarkerObject getMarkerObject ( int index ) const#

Returns the marker object with the specified marker index.

Arguments

  • int index - Marker index.

Return value

Marker object.

void setStreamEnvironmentCubemapEnabled ( bool enabled ) #

Enables or disables the cubemap streaming from AR cameras.

Arguments

  • bool enabled - true to enable the cubemap streaming; false to disable it.

bool isStreamEnvironmentCubemapEnabled ( ) const#

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

Return value

true if the cubemap streaming is enabled; otherwise - false.

void setStreamColorCorrectionEnabled ( bool enabled ) #

Enables or disables the AR cameras streaming exposition.

Arguments

  • bool enabled - true to enable the streaming exposition; false to disable it.

bool isStreamColorCorrectionEnabled ( ) const#

Returns a value indicating if the AR cameras streaming exposition is enabled.

Return value

true if the streaming exposition is enabled; otherwise - false.

void setStreamEnvironmentCubemapGGXQuality ( float quality ) #

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

Arguments

  • float quality - Quality value within the [0.0f; 1.0f] range.

float getStreamEnvironmentCubemapGGXQuality ( ) const#

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

Return value

Quality value within the [0.0f; 1.0f] range.

void setViewOffset ( double offset ) #

Sets the eyes view offset.

Arguments

  • double offset - View offset.

double getViewOffset ( ) const#

Returns the eyes view offset.

Return value

View offset.

void setStreamEnvironmentCubemapMode ( Varjo::ENVIRONMENT_MODE mode ) #

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

Arguments

Varjo::ENVIRONMENT_MODE getStreamEnvironmentCubemapMode ( ) const#

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

Return value

Environment mode.

void setStreamEnvironmentCubemapPresetIndex ( int index ) #

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

Arguments

int getStreamEnvironmentCubemapPresetIndex ( ) const#

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

Return value

Index of the environment preset.

String getHMDName ( ) const#

Returns the current name of the head-mounted display.

Return value

HMD name.

Varjo::HMD_TYPE getHMDType ( ) const#

Returns the type of the head-mounted display.

Return value

HMD type name. One of the HMD_TYPE_* values.

Math::Vec3 getHandtrackingOffset ( ) const#

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

Return value

Hand tracking offset along the axes, in units.

void setMotionPrediction ( bool prediction ) #

Enables support for Motion Prediction in Varjo Headsets by allowing engine to submit Velocity from the GBuffer to the Varjo Composer.

Arguments

  • bool prediction - true to enable support for Motion Prediction; false to disable it.

bool isMotionPrediction ( ) const#

Returns the value indicating if Motion Prediction in Varjo Headsets is enabled.

Return value

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

void setMotionPredictionVelocityPrecision ( float precision ) #

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

Arguments

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

float getMotionPredictionVelocityPrecision ( ) const#

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

Return value

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

void setMotionPredictionVelocityTimeDelta ( float delta ) #

Sets the factor for optimizing between fast and slow moving objects. Smaller number works better for fast moving objects and vice versa.

Arguments

  • float delta - The factor for optimizing between fast and slow moving objects.

float getMotionPredictionVelocityTimeDelta ( ) const#

Returns the factor for optimizing between fast and slow moving objects.

Return value

The factor for optimizing between fast and slow moving objects.

void render ( const Ptr<Player> & player, const Math::ivec2 & size, bool render_window ) #

Calls Varjo rendering logic.

Arguments

  • const Ptr<Player> & player - The player camera.
  • const Math::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.

void setFocusViewportSupersamplingFactor ( float factor = 1.0f ) #

Sets the additional supersampling factor for the Varjo focus viewport.

Arguments

  • float factor - The additional supersampling factor, a float value greater than 0.

float getFocusViewportSupersamplingFactor ( ) const#

Returns the additional supersampling factor for the Varjo focus viewport.

Return value

The additional supersampling factor.

void setStreamColorCorrectionWhiteBalanceEnabled ( bool enabled ) #

Enables white balance correction for the stream.

Arguments

  • bool enabled - true to enable white balance correction for the stream; false to disable it.

bool isStreamColorCorrectionWhiteBalanceEnabled ( ) const#

Returns the value indicating if white balance correction for the stream is enabled.

Return value

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

void setBlendMaskingMode ( Varjo::BLEND_MASKING_MODE mode ) #

Sets the mode of the Blend Control Mask that can be used to extend or restrict the chroma-key mask or to control the depth testing against the estimated video depth.

Arguments

Varjo::BLEND_MASKING_MODE getBlendMaskingMode ( ) const#

Returns a value representing the mode of the Blend Control Mask that can be used to extend or restrict the chroma-key mask or to control the depth testing against the estimated video depth.

Return value

The masking mode. One of the BLEND_MASKING_MODE variables.

void setBlendMaskingDebugEnabled ( bool enabled ) #

Enables blend masking debug visualization.

Arguments

  • bool enabled - true to enable blend masking debug visualization; false to disable it.

bool isBlendMaskingDebugEnabled ( ) const#

Returns the value indicating if blend masking debug visualization is enabled.

Return value

true if blend masking debug visualization is enabled; otherwise - false.
Last update: 2024-10-09
Build: ()