QVR 4.1.0
A library to build Virtual Reality applications
Loading...
Searching...
No Matches
QVRDeviceConfig Class Reference

Configuration of a QVRDevice. More...

#include <config.hpp>

Public Member Functions

 QVRDeviceConfig ()
 Constructor.
 
const QString & id () const
 Returns the unique id.
 
int processIndex () const
 Returns the index of the owning process.
 
QVRDeviceTrackingType trackingType () const
 Returns the tracking type.
 
const QString & trackingParameters () const
 Returns the tracking parameters.
 
QVRDeviceButtonsType buttonsType () const
 Returns the buttons type.
 
const QString & buttonsParameters () const
 Returns the buttons parameters.
 
QVRDeviceAnalogsType analogsType () const
 Returns the analogs type.
 
const QString & analogsParameters () const
 Returns the analogs parameters.
 

Friends

class QVRConfig
 

Detailed Description

Configuration of a QVRDevice.

Constructor & Destructor Documentation

◆ QVRDeviceConfig()

QVRDeviceConfig::QVRDeviceConfig ( )

Constructor.

Member Function Documentation

◆ analogsParameters()

const QString & QVRDeviceConfig::analogsParameters ( ) const
inline

Returns the analogs parameters.

These parameters sometimes define analog elemt names. The following names have a special meaning that translates to a QVRAnalog value: trigger, left-trigger, right-trigger, grip, left-grip, right-grip, axis-x, axis-y, left-axis-x, left-axis-y, right-axis-x, right-axis-y. Triggers and grips have values in [0,1], while axes have values in [-1,1].

For QVR_Device_Analogs_None, parameters are ignored.

For QVR_Device_Analogs_Static, the parameter string is a list of name / value pairs, e.g. trigger 0 axis-x 0.5. The value must be in [0,1] or [-1,1].

For QVR_Device_Analogs_Gamepad, the parameter string is the identifier of the gamepad. The default is 0 which identifies the first gamepad found by Qt; higher numbers identify additional controllers. There will be 6 gamepad analogs: right-axis-y, right-axis-x, left-axis-y, left-axis-x, right-trigger, left-trigger.

For QVR_Device_Analogs_VRPN, the parameter string is of the form <tracker> [<name0> [<name1> [...]]] where <tracker> is the VRPN tracker name, e.g. Tracker0@localhost and the optional analog name list specifies how many analog elements the device has and what meaning each of them has. Example: Tracker0\@localhost trigger axis-x axis-y defines 3 analog elements (VRPN analog element indices 0, 1, 2) and gives them a meaning according to their name.

For QVR_Device_Analogs_Oculus, the parameter string must be "xbox", "controller-left", or "controller-right". The left and right controllers each have 4 analog elements: axis-y, axis-x, trigger, grip. The xbox controller has 8 analog elements: left-axis-y, left-axis-x, right-axis-y, right-axis-x, left-trigger, right-trigger, left-grip, right-grip.

For QVR_Device_Analogs_OpenVR, the parameter string must be either "controller-0" or "controller-1". There will be 3 analogs: axis-y, axis-x, trigger.

For QVR_Device_Analogs_GoogleVR, the parameter string must currently be "daydream".

◆ analogsType()

QVRDeviceAnalogsType QVRDeviceConfig::analogsType ( ) const
inline

Returns the analogs type.

◆ buttonsParameters()

const QString & QVRDeviceConfig::buttonsParameters ( ) const
inline

Returns the buttons parameters.

These parameters sometimes define button names. The following button names have a special meaning that translates to a QVRButton value: l1, l2, l3, r1, r2, r3, a, b, x, y, up, down, left, right, center, select, start, menu, back.

For QVR_Device_Buttons_None, parameters are ignored.

For QVR_Device_Buttons_Static, the parameter string is a list of name / value pairs, e.g. up 0 down 1 left 0 right 0. The value must be either 0 (button not pressed) or 1 (button pressed).

For QVR_Device_Buttons_Gamepad, the parameter string is the identifier of the gamepad. The default is 0 which identifies the first gamepad found by Qt; higher numbers identify additional controllers. There will be the following 18 gamepad buttons: up, down, left, right, l1, r1, l2, r2, l3, r3, a, b, x, y, center, menu, select, start.

For QVR_Device_Buttons_VRPN, the parameter string is of the form <tracker> [<name0> [<name1> [...]]] where <tracker> is the VRPN tracker name, e.g. Tracker0@localhost and the optional button name list specifies how many buttons the device has and what meaning each button has. Example: Tracker0\@localhost up down left right l1 l2 defines 6 buttons (VRPN button indices 0, 1, 2, 3, 4, 5) and gives them a meaning according to their name.

For QVR_Device_Buttons_Oculus, the parameter string must be "xbox", "controller-left", or "controller-right". The left controller has 8 buttons: up, down, left, right, x, y, l1, menu. The right controller has 8 buttons: up, down, left, right, a, b, r1, menu. Note that the up, down, left, right buttons on controllers are only simulated: they will report to be pressed when the analog value of their direction exceeds 0.5. The xbox controller has 12 buttons: up, down, left, right, a, b, x, y, l1, r1, menu, back.

For QVR_Device_Buttons_OpenVR, the parameter string must be either "controller-0" or "controller-1". There will be 6 buttons: up, down, left, right, menu, grip. Note that the four direction buttons are only simulated: they will report to be pressed when the analog value of their direction exceeds 0.5.

For QVR_Device_Buttons_GoogleVR, the parameter string is either "touch" or "daydream".

◆ buttonsType()

QVRDeviceButtonsType QVRDeviceConfig::buttonsType ( ) const
inline

Returns the buttons type.

◆ id()

const QString & QVRDeviceConfig::id ( ) const
inline

Returns the unique id.

◆ processIndex()

int QVRDeviceConfig::processIndex ( ) const
inline

Returns the index of the owning process.

This is 0 (the main process) by default, but in special cases (such as remote processes) a different process can own a device.

The corresponding configuration file entry for the device is process <id> (note that the id and not the index is used).

◆ trackingParameters()

const QString & QVRDeviceConfig::trackingParameters ( ) const
inline

Returns the tracking parameters.

For QVR_Device_Tracking_None, parameters are ignored.

For QVR_Device_Tracking_Static, the parameter string is of the form [<pos-x> <pos-y> <pos-z>] [<pitch> <yaw> <roll>] where the first three numbers give the static position and the last three numbers give the static orientation as euler angles.

For QVR_Device_Tracking_VRPN, the parameter string is of the form <name> [<sensor>] where <name> is the VRPN tracker name, e.g. Tracker0@localhost, and <sensor> is the number of the sensor to be used (can be omitted to use all).

For QVR_Device_Tracking_Oculus, the parameter string must be one of "head", "eye-left", "eye-right", "controller-left", and "controller-right".

For QVR_Device_Tracking_OpenVR, the parameter string must be one of "head", "eye-left", "eye-right", "controller-0", and "controller-1".

For QVR_Device_Tracking_GoogleVR, the parameter string must be one of "head", "eye-left", "eye-right", "daydream".

◆ trackingType()

QVRDeviceTrackingType QVRDeviceConfig::trackingType ( ) const
inline

Returns the tracking type.

Friends And Related Symbol Documentation

◆ QVRConfig

friend class QVRConfig
friend

The documentation for this class was generated from the following file: