|
|
| QVRDevice () |
| Constructor.
|
|
| QVRDevice (int index) |
| Constructor for the device with the given index in the QVR configuration.
|
|
| QVRDevice (const QVRDevice &d) |
| Copy constructor.
|
|
| ~QVRDevice () |
| Destructor.
|
|
const QVRDevice & | operator= (const QVRDevice &d) |
| Assignment operator.
|
|
|
int | index () const |
| Returns the index of the device in the QVR configuration.
|
|
const QString & | id () const |
| Returns the unique id.
|
|
const QVRDeviceConfig & | config () const |
| Returns the configuration.
|
|
|
const QVector3D & | position () const |
| Returns the position.
|
|
const QQuaternion & | orientation () const |
| Returns the orientation.
|
|
const QVector3D & | velocity () const |
| Returns the velocity, in m/s.
|
|
const QVector3D & | angularVelocity () const |
| Returns the angular velocity. The direction of the returned vector specifies the axis of rotation, and its length gives the rotation speed in radians/s.
|
|
QMatrix4x4 | matrix () const |
| Returns the position and orientation as a matrix.
|
|
|
int | buttonCount () const |
| Returns the number of buttons on this device.
|
|
QVRButton | button (int index) const |
| Returns the type of the button with index.
|
|
int | buttonIndex (QVRButton btn) const |
| Returns the index of the button btn, or -1 if this device does not have that button.
|
|
bool | hasButton (QVRButton btn) const |
| Returns whether this device has button btn.
|
|
bool | isButtonPressed (int index) const |
| Returns whether the button with the given index is pressed.
|
|
bool | isButtonPressed (QVRButton btn) const |
| Returns whether the button btn is pressed. Returns false if this device does not have that button.
|
|
int | analogCount () const |
| Returns the number of analog joystick elements on this device. Usually index 0 will be the x axis and index 1 the y axis for two-dimensional joysticks.
|
|
QVRAnalog | analog (int index) const |
| Returns the type of the analog element with index.
|
|
int | analogIndex (QVRAnalog anlg) const |
| Returns the index of the analog element anlg, or -1 if this device does not have that element.
|
|
bool | hasAnalog (QVRAnalog anlg) const |
| Returns whether this device has analog element anlg.
|
|
float | analogValue (int index) const |
| Returns the value of the analog joystick element with the given index. This is either in [-1,1] (for axis-type analog elements) or in [0,1] (for trigger-type analog elements).
|
|
float | analogValue (QVRAnalog anlg) const |
| Returns the value of the analog element anlg. Returns 0 if this device does not have that element.
|
|
|
A renderable representation of a device consists of one or more nodes. Each node has its own transformation (position and orientation) and contains vertex data (positions, normals, texture coordinates) and optionally a texture.
You can query the number of nodes with modelNodeCount() and then render all nodes sequentially to get the full device representation.
Since the representation of the device depends on its state (buttons, analog elements, ...), the number of nodes and their transformations may change between frames. However, vertex data and textures with a given index are constant and can therefore be uploaded to GPU buffers once and then reused.
|
int | modelNodeCount () const |
| Returns the number of nodes that are currently in the renderable device model, or 0 if there is no such model. This depends on the current state of the device and can therefore change between frames.
|
|
QVector3D | modelNodePosition (int nodeIndex) const |
| Returns the current position of the renderable device model node with the given index. This depends on the current state of the device and can therefore change between frames.
|
|
QQuaternion | modelNodeOrientation (int nodeIndex) const |
| Returns the current orientation of the renderable device model node with the given index. This depends on the current state of the device and can therefore change between frames.
|
|
QMatrix4x4 | modelNodeMatrix (int nodeIndex) const |
| Returns the position and orientation of the renderable device model node with the given index as a matrix. This depends on the current state of the device and can therefore change between frames.
|
|
int | modelNodeVertexDataIndex (int nodeIndex) const |
| Returns the index of the vertex data block associated with the given renderable device model node. Pass this index to QVRManager::deviceModelVertexCound(), QVRManager::deviceModelVertexPositions(), QVRManager::deviceModelVertexNormals(), and QVRManager::deviceModelVertexTexCoords() to get the actual vertex data. Vertex data with a given index never changes, so you can e.g. upload this data to a GPU buffer once and reuse it.
|
|
int | modelNodeTextureIndex (int nodeIndex) const |
| Returns the index of the texture associated with the given renderable device model node. Pass this index to QVRManager::deviceModelTexture() to get the actual texture data. Texture data with a given index never changes, so you can e.g. upload this data to a GPU buffer once and reuse it.
|
|
|
Some devices, usually hand-held controllers, support haptic pulses.
|
bool | supportsHapticPulse () const |
| Returns whether this device supports haptic pulses.
|
|
void | triggerHapticPulse (int microseconds) const |
| Triggers a haptic pulse with the given duration in microseconds. Note that there may be a device-dependent limit on the duration; for now, avoid values larger than 3999.
|
|
Device for interaction purposes.
A device is anything a Virtual Reality application might use for interaction purposes, e.g. a wand, a flystick, a 3DOF or 6DOF tracker target, or similar; in short, anything that may be tracked, has buttons, and/or has analog joystick functionality.
For example, tracked glasses can be used to track an observer, and a game controller can be used for navigation.
A device is configured via QVRDeviceConfig.