sonus::Haptics Class Reference

#include <Haptics.h>

List of all members.

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)


Detailed Description

sonus::Haptics

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

Date:
2008/08/24 66:66
Author:
Alexander Lawrence
Version:
1.0
See also:
WallMaterial

Constructor & Destructor Documentation

sonus::Haptics::Haptics (  ) 

Constructor

sonus::Haptics::~Haptics (  ) 

Destructor.


Member Function Documentation

void sonus::Haptics::getPosition ( Vector3D vec  ) 

Saves current position of haptic device into given vector.

Parameters:
force pointer to output position vector

void sonus::Haptics::getVelocity ( Vector3D vec  ) 

Saves current velocity of haptic device into given vector.

Parameters:
force pointer to output velocity vector

void sonus::Haptics::getAcceleration ( Vector3D vec  ) 

Saves current acceleration of haptic device into given vector.

Parameters:
force pointer to output acceleration vector

void sonus::Haptics::setForce ( Vector3D  force  ) 

Sets current haptic force to given vector values.

Parameters:
force input force vector

void sonus::Haptics::getForce ( Vector3D force  ) 

Saves current set haptic force into given vector.

Parameters:
force pointer to output force vector

void sonus::Haptics::addForce ( Vector3D  force  ) 

Adds given vector values to current haptic force

Parameters:
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.

Parameters:
level new level
See also:
sonus::Level2D

sonus::Application

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.

Parameters:
level current level
See also:
sonus::Level2D

sonus::Application

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.

Parameters:
button checked button
Returns:
whether a certain button is pressed or not

bool sonus::Haptics::buttonPressed (  ) 

Returns if a button of the haptic device is pressed. Returns also true if multiple buttons are pressed.

Returns:
whether a button is pressed or not


Friends And Related Function Documentation

HDLServoOpExitCode HapticsServoOp ( void *  data  )  [friend]

The main method for receiving input data from the haptics device and setting forces for the game.

Parameters:
data pointer to the Haptics object itself
Returns:
operation exit code; to determine whether the haptic device loop should be cancelled or not


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 12:26:54 2008 for sonus by  doxygen 1.5.4