#include <H3DHapticsDevice.h>
Inheritance diagram for H3D::H3DHapticsDevice:

Public Member Functions | |
| H3DHapticsDevice (Inst< SFVec3f > _devicePosition=0, Inst< SFRotation > _deviceOrientation=0, Inst< TrackerPosition > _trackerPosition=0, Inst< TrackerOrientation > _trackerOrientation=0, Inst< PosCalibration > _positionCalibration=0, Inst< OrnCalibration > _orientationCalibration=0, Inst< SFVec3f > _proxyPosition=0, Inst< WeightedProxy > _weightedProxyPosition=0, Inst< SFFloat > _proxyWeighting=0, Inst< SFBool > _main_button=0, Inst< SFVec3f > _force=0, Inst< SFVec3f > _torque=0, Inst< SFInt32 > _inputDOF=0, Inst< SFInt32 > _outputDOF=0, Inst< SFInt32 > _hapticsRate=0, Inst< SFNode > _stylus=0, Inst< SFBool > _initialized=0) | |
| Constructor. | |
| virtual | ~H3DHapticsDevice () |
| Destructor. Stops haptics rendering and remove callback functions. | |
| Vec3f | getPreviousProxyPosition () |
| Get the proxy position from the previous loop. | |
| virtual string | defaultXMLContainerField () |
| Returns the default xml containerField attribute value. | |
| virtual void | initDevice () |
| Does all the initialization needed for the device before starting to use it. | |
| PeriodicThreadBase * | getThread () |
| Get the thread that is used to run this haptics device. | |
| virtual void | resetDevice () |
| Reset the device. | |
| virtual void | disableDevice () |
| Perform cleanup and let go of all device resources that are allocated. | |
| virtual void | updateDeviceValues () |
| This function is used to transfer device values, such as position, button status etc from the realtime loop to the fields of H3DHapticsDevice, and possible vice versa. | |
| virtual void | preRender () |
| This function is called at the start of each scenegraph loop before any calls to other HapticDevice functions and can be used to perform any necessary operation that are needed for the other calls to function properly. | |
| virtual void | postRender () |
| This function is called at the end of each scenegraph loop after all calls to other HapticDevice functions and can be used to perform any necessary operation that are needed. | |
Public Attributes | |
| auto_ptr< SFVec3f > | devicePosition |
| The position of the device given in the coordinate system of the device. | |
| auto_ptr< SFRotation > | deviceOrientation |
| The orientation of the device given in the coordinate system of the device. | |
| auto_ptr< TrackerPosition > | trackerPosition |
| The position of the device in the world coordinates of the API. | |
| auto_ptr< TrackerOrientation > | trackerOrientation |
| The orientation of the device in the world coordinates of the API. | |
| auto_ptr< PosCalibration > | positionCalibration |
| The calibration matrix between devicePosition and trackerPosition. | |
| auto_ptr< OrnCalibration > | orientationCalibration |
| The calibration rotation between deviceOrientation and trackerOrientation. | |
| auto_ptr< SFVec3f > | proxyPosition |
| The position of the proxy used in the haptic rendering. | |
| auto_ptr< SFVec3f > | weightedProxyPosition |
| A weighted position between proxyPosition and trackerPosition. | |
| auto_ptr< SFFloat > | proxyWeighting |
| The weighting between proxyPosition and trackerPosition when calculating weightedProxyPosition. | |
| auto_ptr< SFBool > | mainButton |
| The state of the main button. | |
| auto_ptr< SFVec3f > | force |
| The approximation of the force that has been rendered during the last scenegraph loop. | |
| auto_ptr< SFVec3f > | torque |
| The approximation of the torque that has been rendered during the last scenegraph loop. | |
| auto_ptr< SFInt32 > | inputDOF |
| The degrees of freedom supported as input. | |
| auto_ptr< SFInt32 > | outputDOF |
| The degrees of freedom supported as output, i.e. | |
| auto_ptr< SFInt32 > | hapticsRate |
| The update rate of the servoloop of the H3DHapticsDevice. | |
| auto_ptr< SFNode > | stylus |
| The Node used as the visual representation of the stylus. | |
| auto_ptr< SFBool > | initialized |
| true if the device is initialized and ready for calls to updateDeviceValues() and renderObjects(). | |
Static Public Attributes | |
| static H3DNodeDatabase | database |
| Node database entry. | |
Protected Attributes | |
| Vec3f | previuos_proxy_pos |
| PeriodicThreadBase * | thread |
| The thread that this haptics device loop is run in. | |
Classes | |
| class | OrnCalibration |
| Saves the value of the field in a variable that can be accessed from the realtime loop. More... | |
| class | PosCalibration |
| Saves the value of the field in a variable that can be accessed from the realtime loop. More... | |
| class | TrackerOrientation |
| The TrackerOrientation field updates itself from the device_orientation and orientation_calibration fields. More... | |
| class | TrackerPosition |
| The TrackerPosition field updates itself from the device_position and position_calibration fields. More... | |
| class | WeightedProxy |
| The WeightedProxy field updates to be a value between the proxy position and tracker position depending on the value of a weighting factor. More... | |
It contains information about the haptics device, e.g. the position and orientation of the device, the forces being rendered and supported degrees of freedom. It also contains functions for rendering HapticObject instances on the device. Subclasses should override renderObjects() to render the objects on the H3DHapticsDevice.
|
|
Returns the default xml containerField attribute value. For this node it is "appearance". Reimplemented from H3D::Node. |
|
|
Perform cleanup and let go of all device resources that are allocated. After a call to this function no haptic rendering can be performed on the device until the initDevice() function has been called again. Reimplemented in H3D::DHDHapticsDevice, H3D::H3DThreadedHapticsDevice, H3D::HaptikHapticsDevice, and H3D::HLHapticsDevice. |
|
|
The orientation of the device given in the coordinate system of the device. Only applicable if the device supports orientation as input.
Access type: outputOnly
|
|
|
The position of the device given in the coordinate system of the device.
Access type: outputOnly
|
|
|
The approximation of the force that has been rendered during the last scenegraph loop.
Access type: outputOnly
|
|
|
The update rate of the servoloop of the H3DHapticsDevice.
Access type: outputOnly
|
|
|
true if the device is initialized and ready for calls to updateDeviceValues() and renderObjects(). If not initDevice() will have to be called in order to initialize it before calling those functions.
Access type: outputOnly
|
|
|
The degrees of freedom supported as input.
Access type: outputOnly
|
|
|
The state of the main button. true means that the button is pressed.
Access type: outputOnly
|
|
|
The calibration rotation between deviceOrientation and trackerOrientation.
Access type: inputOutput
|
|
|
The degrees of freedom supported as output, i.e. forces and torques.
Access type: outputOnly
|
|
|
The calibration matrix between devicePosition and trackerPosition.
Access type: inputOutput
|
|
|
The position of the proxy used in the haptic rendering.
Access type: outputOnly
|
|
|
The weighting between proxyPosition and trackerPosition when calculating weightedProxyPosition. The value should be between 0 and 1, with 1 meaning that the weightedProxyPosition is the proxyPosition and 0 that it is the trackerPosition.
Access type: inputOutput
|
|
|
The Node used as the visual representation of the stylus.
Access type: outputOnly
|
|
|
The approximation of the torque that has been rendered during the last scenegraph loop.
Access type: outputOnly
|
|
|
The orientation of the device in the world coordinates of the API.
Access type: outputOnly
|
|
|
The position of the device in the world coordinates of the API.
Access type: outputOnly
|
|
|
A weighted position between proxyPosition and trackerPosition. The weighting factor is the proxyWeigting field. By default this is the field that is used to display the stylus graphically.
Access type: outputOnly
|
1.4.5