OIS  1.5
Object-oriented Input System
Public Types | Public Member Functions | Protected Attributes | List of all members
OIS::ForceFeedback Class Referenceabstract

#include <OISForceFeedback.h>

Inheritance diagram for OIS::ForceFeedback:
OIS::Interface

Public Types

typedef std::multimap< Effect::EForce, Effect::ETypeSupportedEffectList
 
- Public Types inherited from OIS::Interface
enum  IType { ForceFeedback, Reserved }
 Type of Interface. More...
 

Public Member Functions

 ForceFeedback ()
 
virtual ~ForceFeedback ()
 
virtual void setMasterGain (float level)=0
 
virtual void setAutoCenterMode (bool auto_on)=0
 
virtual void upload (const Effect *effect)=0
 
virtual void modify (const Effect *effect)=0
 
virtual void remove (const Effect *effect)=0
 
virtual short getFFAxesNumber ()=0
 
virtual unsigned short getFFMemoryLoad ()=0
 
const SupportedEffectListgetSupportedEffects () const
 
bool supportsEffect (Effect::EForce force, Effect::EType type) const
 
void _addEffectTypes (Effect::EForce force, Effect::EType type)
 
void _setGainSupport (bool on)
 
void _setAutoCenterSupport (bool on)
 
- Public Member Functions inherited from OIS::Interface
virtual ~Interface ()
 

Protected Attributes

SupportedEffectList mSupportedEffects
 
bool mSetGainSupport
 
bool mSetAutoCenterSupport
 

Detailed Description

Interface class for dealing with Force Feedback devices

Member Typedef Documentation

◆ SupportedEffectList

Constructor & Destructor Documentation

◆ ForceFeedback()

ForceFeedback::ForceFeedback ( )

◆ ~ForceFeedback()

virtual OIS::ForceFeedback::~ForceFeedback ( )
inlinevirtual

Member Function Documentation

◆ _addEffectTypes()

void ForceFeedback::_addEffectTypes ( Effect::EForce  force,
Effect::EType  type 
)

◆ _setAutoCenterSupport()

void ForceFeedback::_setAutoCenterSupport ( bool  on)

◆ _setGainSupport()

void ForceFeedback::_setGainSupport ( bool  on)

◆ getFFAxesNumber()

virtual short OIS::ForceFeedback::getFFAxesNumber ( )
pure virtual
Remarks
Get the number of supported Axes for FF usage

◆ getFFMemoryLoad()

virtual unsigned short OIS::ForceFeedback::getFFMemoryLoad ( )
pure virtual
Remarks
Get the current load (%, in [0, 100] of the FF device memory

◆ getSupportedEffects()

const ForceFeedback::SupportedEffectList & ForceFeedback::getSupportedEffects ( ) const
Remarks
Get a list of all supported effects

◆ modify()

virtual void OIS::ForceFeedback::modify ( const Effect effect)
pure virtual
Remarks
Modifies an effect that is currently playing

◆ remove()

virtual void OIS::ForceFeedback::remove ( const Effect effect)
pure virtual
Remarks
Remove the effect from the device

◆ setAutoCenterMode()

virtual void OIS::ForceFeedback::setAutoCenterMode ( bool  auto_on)
pure virtual
Remarks
If using Force Feedback effects, this should be turned off before uploading any effects. Auto centering is the motor moving the joystick back to center. DirectInput only has an on/off setting, whereas linux has levels.. Though, we go with DI's on/off mode only Note: If the device does not support auto-centering, nothing is done
Parameters
auto_ontrue to turn auto centering on, false to turn off.

◆ setMasterGain()

virtual void OIS::ForceFeedback::setMasterGain ( float  level)
pure virtual
Remarks
This is like setting the master volume of an audio device. Individual effects have gain levels; however, this affects all effects at once. Note: If the device does not support master gain setting, nothing is done
Parameters
levelA value between 0.0 and 1.0 represent the percentage of gain. 1.0 being the highest possible force level (means no scaling).

◆ supportsEffect()

bool ForceFeedback::supportsEffect ( Effect::EForce  force,
Effect::EType  type 
) const
Remarks
Tell if a given force / effect type pair is supported

◆ upload()

virtual void OIS::ForceFeedback::upload ( const Effect effect)
pure virtual
Remarks
Creates and Plays the effect immediately. If the device is full of effects, it will fail to be uploaded. You will know this by an invalid Effect Handle

Member Data Documentation

◆ mSetAutoCenterSupport

bool OIS::ForceFeedback::mSetAutoCenterSupport
protected

◆ mSetGainSupport

bool OIS::ForceFeedback::mSetGainSupport
protected

◆ mSupportedEffects

SupportedEffectList OIS::ForceFeedback::mSupportedEffects
protected

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