OgreHaptics::ForceEffectAlgorithm Class Reference

ForceEffectAlgorithm is used for the actual force calculations for the haptic rendering of a ForceEffect. More...

#include <OgreHapticsForceEffectAlgorithm.h>

List of all members.

Public Member Functions

 ForceEffectAlgorithm (const String &type)
 Default constructor.
virtual ~ForceEffectAlgorithm ()
 Virtual destructor.
virtual const String & getType (void) const
 Returns the name of the type of algorithm.
virtual void reset (void)
 Resets parameters used by the algorithm.
virtual const ForceOutputcalculateForces (const Vector3 &position, const Quaternion &orientation, const Vector3 &linearVelocity, const Vector3 &angularVelocity, double timeElapsed)=0
 Called from the haptic thread to calculate the forces and torques to be added to the final output of the current haptic frame in which this is operation is called.

Protected Attributes

String mType
 Name of the type of algorithm.
ForceOutput mOutput
 Output of the algorithm, to be used by subclasses.


Detailed Description

ForceEffectAlgorithm is used for the actual force calculations for the haptic rendering of a ForceEffect.

Remarks:
This class is an abstract base class which all concrete algorithms must implement. The ForceEffectAlgorithm class is not thread safe, e.g. setting parameters directly on a algorithm while it is being used for rendering forces results in undefined behaviour.
To update an actively used algorithm use the ForceEffect class using the algorithm.
See also:
ForceEffect::setAlgorithmParameter

ForceEffect::setAlgorithmParameterList

ForceEffect::setAllAlgorithmsParameter

ForceEffect::setAllAlgorithmsParameterList

Definition at line 48 of file OgreHapticsForceEffectAlgorithm.h.


Constructor & Destructor Documentation

OgreHaptics::ForceEffectAlgorithm::ForceEffectAlgorithm ( const String &  type  ) 

Default constructor.

virtual OgreHaptics::ForceEffectAlgorithm::~ForceEffectAlgorithm (  )  [virtual]

Virtual destructor.

Definition at line 54 of file OgreHapticsForceEffectAlgorithm.h.


Member Function Documentation

virtual const String& OgreHaptics::ForceEffectAlgorithm::getType ( void   )  const [virtual]

Returns the name of the type of algorithm.

Remarks:
This property is useful for determining the type of algorithm procedurally so another can be created.

Definition at line 62 of file OgreHapticsForceEffectAlgorithm.h.

virtual void OgreHaptics::ForceEffectAlgorithm::reset ( void   )  [virtual]

Resets parameters used by the algorithm.

Remarks:
At the start of rendering some parameters might need to be set to an initial value. Such is the case in algorithms which use the total elapsed time during calculations, such as sine wave functions.
This operation provide the means to initialise these specific parameters, allowing subclasses to implement if needed.

Definition at line 74 of file OgreHapticsForceEffectAlgorithm.h.

virtual const ForceOutput& OgreHaptics::ForceEffectAlgorithm::calculateForces ( const Vector3 &  position,
const Quaternion &  orientation,
const Vector3 &  linearVelocity,
const Vector3 &  angularVelocity,
double  timeElapsed 
) [pure virtual]

Called from the haptic thread to calculate the forces and torques to be added to the final output of the current haptic frame in which this is operation is called.

Parameters:
position The position of a device in device space coordinates.
orientation The orientation of a device in device space coordinates.
linearVelocity The linear velocity of a device in device space coordinates.
angularVelocity The angular velocity of a device in device space coordinates.
timeElapsed The time since the last call in seconds.


Member Data Documentation

Name of the type of algorithm.

Definition at line 94 of file OgreHapticsForceEffectAlgorithm.h.

Output of the algorithm, to be used by subclasses.

Definition at line 96 of file OgreHapticsForceEffectAlgorithm.h.


The documentation for this class was generated from the following file:

Last modified Tue Jan 6 22:31:26 2009