#include <Haptics.h>
Public Member Functions | |
| Haptics () | |
| void | getPosition (Vector3D *vec) |
| void | getVelocity (Vector3D *vec) |
| void | getAcceleration (Vector3D *vec) |
| void | setForce (Vector3D force) |
| void | getForce (Vector3D *force) |
| void | addForce (Vector3D force) |
| void | initLevel (Level2D *level) |
| void | update (Level2D *level) |
| void | endLevel () |
| bool | buttonPressed (HapticsButton button) |
| bool | buttonPressed () |
| ~Haptics () | |
Public Attributes | |
| float | BOUNDARIES_MULTIPLIER |
| float | WALL_MULTIPLIER |
| bool | active |
| WallMaterial | wallMaterial |
Static Public Attributes | |
| static const int | BUTTON_MIDDLE = 1 |
| static const int | BUTTON_LEFT = 2 |
| static const int | BUTTON_FRONT = 4 |
| static const int | BUTTON_RIGHT = 8 |
Friends | |
| HDLServoOpExitCode | HapticsServoOp (void *data) |
The haptics module encapsulates the Novint HDAL and extends the basic functionality of it. A Haptics object holds position, velocity, accleration and button state data of a haptic device. Additionally it adds all neccessary functionality for the game, including force feedback calculation for walking simulation, workspace reduction and wall/obstacle simulation.
filename: Haptics.h
| sonus::Haptics::Haptics | ( | ) |
Constructor
| sonus::Haptics::~Haptics | ( | ) |
Destructor.
| void sonus::Haptics::getPosition | ( | Vector3D * | vec | ) |
Saves current position of haptic device into given vector.
| force | pointer to output position vector |
| void sonus::Haptics::getVelocity | ( | Vector3D * | vec | ) |
Saves current velocity of haptic device into given vector.
| force | pointer to output velocity vector |
| void sonus::Haptics::getAcceleration | ( | Vector3D * | vec | ) |
Saves current acceleration of haptic device into given vector.
| force | pointer to output acceleration vector |
| void sonus::Haptics::setForce | ( | Vector3D | force | ) |
Sets current haptic force to given vector values.
| force | input force vector |
| void sonus::Haptics::getForce | ( | Vector3D * | force | ) |
Saves current set haptic force into given vector.
| force | pointer to output force vector |
| void sonus::Haptics::addForce | ( | Vector3D | force | ) |
Adds given vector values to current haptic force
| force | additional force vector |
| void sonus::Haptics::initLevel | ( | Level2D * | level | ) |
Initializes a new level by setting basic values and calculating the tranformation vector and scaling.
| level | new level |
| void sonus::Haptics::update | ( | Level2D * | level | ) |
Updates the current level by updating and processing the input of the haptic device. Basically just changing the linear and angular velocity of the virtual player. Note the haptics module is a writing module.
| level | current level |
| void sonus::Haptics::endLevel | ( | ) |
Sets all necessary values in order to end a level correctly.
| bool sonus::Haptics::buttonPressed | ( | HapticsButton | button | ) |
Returns if a certain button of the haptic device is pressed.
| button | checked button |
| bool sonus::Haptics::buttonPressed | ( | ) |
Returns if a button of the haptic device is pressed. Returns also true if multiple buttons are pressed.
| HDLServoOpExitCode HapticsServoOp | ( | void * | data | ) | [friend] |
The main method for receiving input data from the haptics device and setting forces for the game.
| data | pointer to the Haptics object itself |
1.5.4