QVR 4.1.0
A library to build Virtual Reality applications
|
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 |
Configuration of a QVRDevice.
QVRDeviceConfig::QVRDeviceConfig | ( | ) |
Constructor.
|
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".
|
inline |
Returns the analogs type.
|
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".
|
inline |
Returns the buttons type.
|
inline |
Returns the unique id.
|
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).
|
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".
|
inline |
Returns the tracking type.
|
friend |