This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
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
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Plugins::AppVive Class

Header: #include <plugins/UnigineAppVive.h>

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

Notice
AppVive and AppVarjo plugins cannot be used in a Qt-based application.

If AppVive or AppVarjo plugin is loaded together with the engine, the HAS_APP_VIVE definition is set. This definition can be used, for example, to avoid errors if the plugin is not loaded; the code in which the plugin functions are executed can be wrapped around as follows:

Source code (UnigineScript)
#ifdef HAS_APP_VIVE
	// engine.vive functions
#endif

The source code of OpenVR can be found here.

The full set of Vive devices is described here.

See also#

A UnigineScript API sample <UnigineSDK>/data/samples/plugins/app_vive_00

AppVive Class

Members


vec3 getControllerAxis ( int device, int axis ) #

Returns the coordinates of the specified controller axis along the X and Y axes.

Arguments

Return value

X and Y in the range of [-1;1] ([0;1] for a trigger); Z is always zero.

int getControllerButtonPressed ( int device, int button ) #

Returns the value indicating if the specified button is pressed.

Arguments

Return value

1 if the button is pressed; otherwise - 0.

int getControllerButtonTouched ( int device, int button ) #

Returns the value indicating if the specified button is touched.

Arguments

Return value

1 if the button is pressed; otherwise - 0.

int getControllerPacketNum ( int device ) #

Returns the number of the controller packet.

Arguments

  • int device - A device ID.

Return value

Number of the controller packet.

void setControllerVibration ( int device, unsigned short duration ) #

Sets the vibration of the given duration and amplitude.

Arguments

  • int device - ID if the device.
  • unsigned short duration - Duration of the vibration.

vec3 getDeviceAngularVelocity ( int device ) #

Returns a device angular velocity, in radians per second.

Arguments

  • int device - A device ID.

Return value

Angular velocity.

bool isDeviceConnected ( int device ) #

Returns a value indicating if the device connected to the slot.

Arguments

  • int device - A device ID.

Return value

true - connected; false - not connected.

mat4 getDevicePose ( int device ) #

Returns a single pose for a tracked device.

Arguments

  • int device - A device ID.

Return value

Identity matrix.

int getDeviceType ( int device ) #

Returns the device type.

Arguments

  • int device - A device ID.

Return value

A device type, one of the following predefined constants:

vec3 getDeviceVelocity ( int device ) #

Returns a device velocity in tracker space, in meters per second.

Arguments

  • int device - A device ID.

Return value

Velocity.

void setHeadPositionLock ( int lock ) #

Locks the head position.

Arguments

  • int lock - 1 to lock the head position.

int isHeadPositionLocked ( ) #

Returns the value indicating if the head position is locked.

Return value

1 if the head position is locked; otherwise - 0.

void setHeadRotationLock ( int lock ) #

Locks the head rotation.

Arguments

  • int lock - 1 to lock the head rotation.

int isHeadRotationLocked ( ) #

Returns the value indicating if the head rotation is locked.

Return value

1 if the head rotation is locked; otherwise - 0.

bool isPoseValid ( int device ) #

Returns a value indicating if the device pose is valid.

Arguments

  • int device - A device ID.

Return value

true - valid; false - invalid.

int getTrackingResult ( int device ) #

Returns the value indicating the tracking result:
  • Uninitialized
  • Calibrating in progress
  • Calibrating out of range
  • Running correctly
  • Running out of range

Arguments

  • int device - A device ID.

Return value

Tracking result.

int 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 following values:
  • 0 - no image (black screen)
  • 1 - mono image
  • 2 - stereo image (left and right eye)

void setViewportMode ( int mode ) #

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

Arguments

  • int mode - Viewport mode. One of the following values:
    • 0 - no image (black screen)
    • 1 - mono image
    • 2 - stereo image (left and right eye)
Last update: 2019-12-25
Build: ()