Unigine::Plugins::AppVive Class
Header: | #include <plugins/UnigineAppVive.h> |
This set of functions is available when the AppVive or AppVarjo plugin is loaded.
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:
#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
- int device - A device ID.
- int axis - One of the following predefined constants:
- AXIS_NONE = 0
- AXIS_TRACKPAD = 1
- AXIS_JOYSTICK = 2
- AXIS_TRIGGER = 3
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
- int device - A device ID.
- int button - A button, one of the following predefined constants:
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
- int device - A device ID.
- int button - A button, one of the following predefined constants:
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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)