Unigine.Plugins.AppVive Class
This set of functions is available when the AppVive plugin is loaded.
AppVive plugin cannot be used in a Qt-based application.
If AppVive 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:
#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
Enums
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). |
Properties
AppVive.VIEWPORT ViewportMode#
A value indicating the current viewport mode, that determines the type of image to be displayed in the viewport.
set
Sets the viewport mode, that determines the type of image to be displayed in the viewport.
set value -
Viewport mode. One of the VIEWPORT variables.
Members
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).bool GetControllerButtonPressed ( int device_num, AppVive.BUTTON button ) #
Returns the value indicating if the specified button is pressed.Arguments
- int device_num - Device ID.
- AppVive.BUTTON button - A button, one of the BUTTON variables.
Return value
true if the button is pressed; otherwise - false.bool GetControllerButtonTouched ( int device_num, AppVive.BUTTON button ) #
Returns the value indicating if the specified button is touched.Arguments
- int device_num - Device ID.
- AppVive.BUTTON button - A button, one of the BUTTON variables.
Return value
true if the button is pressed; otherwise - false.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.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.
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.mat4 GetDevicePose ( int device_num ) #
Returns a single pose for a tracked device.Arguments
- int device_num - Device ID.
Return value
Identity matrix.AppVive.DEVICE GetDeviceType ( int device_num ) #
Returns the device type.Arguments
- int device_num - Device ID.
Return value
Device type, one of the DEVICE variables.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.void SetHeadPositionLock ( bool lock ) #
Locks the head position.Arguments
- bool lock - true to lock the head position.
bool IsHeadPositionLocked ( ) #
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 IsHeadRotationLocked ( ) #
Returns the value indicating if the head rotation is locked.Return value
true if the head rotation is locked; otherwise - false.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.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.AppVive.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.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 of the specified device.Arguments
- int device - Device ID.
Return value
Model.AppVive.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-06-04
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)