This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

engine.vive Functions

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

If the 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.

App Class

Members


int engine.app.getControllerAxis(int device)

Returns the axis of the controller (one of the CONTROLLER_AXIS_* variables).

Arguments

  • int device - A device ID.

int engine.app.getControllerButtonPressed(int device)

Returns the pressed button ID.

Arguments

  • int device - A device ID.

int engine.app.getControllerButtonTouched(int device)

Returns the touched button ID.

Arguments

  • int device - A device ID.

int engine.app.getControllerPacketNum(int device)

Returns the number of the packet.

Arguments

  • int device - A device ID.

vec3 engine.app.getDeviceAngularVelocity(int device)

Returns a device angular velocity, in radians per second.

Arguments

  • int device - A device ID.

Return value

Velocity.

bool engine.app.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 engine.app.getDevicePose(int device)

Returns a single pose for a tracked device.

Arguments

  • int device - A device ID.

Return value

Identity matrix.

int engine.app.getDeviceType(int device)

Returns the device type (one of the TRACKED_DEVICE_* variables).

Arguments

  • int device - A device ID.

vec3 engine.app.getDeviceVelocity(int device)

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

Arguments

  • int device - A device ID.

Return value

Velocity.

bool engine.app.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 engine.app.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.

int CONTROLLER_AXIS_JOYSTICK

Description

An axis of a joystick type.

int CONTROLLER_AXIS_NONE

Description

int CONTROLLER_AXIS_TRACKPAD

Description

An axis of a trackpad type.

int CONTROLLER_AXIS_TRIGGER

Description

An axis of a trigger type.

int CONTROLLER_STATE_AXIS_COUNT

Description

A number of axes.

int MAX_TRACKED_DEVICE_COUNT

Description

The maximum value of tracked devices. Default value is 16.

int TRACKED_DEVICE_CONTROLLER

Description

A tracked controller.

int TRACKED_DEVICE_HMD

Description

A tracked head-mounted display.

int TRACKED_DEVICE_INVALID

Description

A tracked device with an invalid index.

int TRACKED_DEVICE_OTHER

Description

A tracked device different from base Vive types.

int TRACKED_DEVICE_TRACKING

Description

A tracked camera and base stations that serve as tracking reference points.
Last update: 2017-07-03
Build: ()