Orxonox: OIS::Win32ForceFeedback Class Reference

# OIS::Win32ForceFeedback Class Reference

`#include <src/ois/win32/Win32ForceFeedback.h>`

Inheritance diagram for OIS::Win32ForceFeedback:

List of all members.

## Public Member Functions

void | _addEffectSupport (LPCDIEFFECTINFO pdei)
short | getFFAxesNumber ()
void | modify (const Effect *effect)
void | remove (const Effect *effect)
void | setAutoCenterMode (bool auto_on)
void | setMasterGain (float level)
void | upload (const Effect *effect)
| Win32ForceFeedback (IDirectInputDevice8 *joy)
| ~Win32ForceFeedback ()

## Protected Types

typedef std::map< int, LPDIRECTINPUTEFFECT > | EffectList

## Protected Member Functions

void | _setCommonProperties (DIEFFECT *diEffect, DWORD *rgdwAxes, LONG *rglDirection, DWORD struct_size, LPVOID struct_type, const Effect *effect)
void | _updateConditionalEffect (const Effect *effect)
void | _updateConstantEffect (const Effect *effect)
void | _updateCustomEffect (const Effect *effect)
void | _updatePeriodicEffect (const Effect *effect)
void | _updateRampEffect (const Effect *effect)
void | _upload (GUID, DIEFFECT *, const Effect *)

## Protected Attributes

EffectList | mEffectList
int | mHandles
IDirectInputDevice8 * | mJoyStick

## Private Member Functions

| Win32ForceFeedback ()

## Member Typedef Documentation

typedef std::map<int,LPDIRECTINPUTEFFECT> OIS::Win32ForceFeedback::EffectList`[protected]`

## Constructor & Destructor Documentation

OIS::Win32ForceFeedback::Win32ForceFeedback | ( |  | ) | `[inline, private]`

Win32ForceFeedback::Win32ForceFeedback | ( | IDirectInputDevice8 * | joy | ) |

Win32ForceFeedback::~Win32ForceFeedback | ( |  | ) |

References mEffectList.

## Member Function Documentation

void Win32ForceFeedback::_addEffectSupport | ( | LPCDIEFFECTINFO | pdei | ) |

Remarks:
  Internal use.. Used during enumeration to build a list of a devices support effects.

References OIS::ForceFeedback::_addEffectTypes(), OIS::Effect::Constant, OIS::Effect::Custom, OIS::Effect::Damper, OIS::Effect::Friction, OIS::Effect::Inertia, OIS::Effect::Ramp, OIS::Effect::SawToothDown, OIS::Effect::SawToothUp, OIS::Effect::Sine, OIS::Effect::Spring, OIS::Effect::Square, and OIS::Effect::Triangle.

Referenced by OIS::Win32JoyStick::DIEnumEffectsCallback().

void Win32ForceFeedback::_setCommonProperties | ( | DIEFFECT * | diEffect,
|  | DWORD * | rgdwAxes,
|  | LONG * | rglDirection,
|  | DWORD | struct_size,
|  | LPVOID | struct_type,
|  | const Effect * | effect |
| ) |  |  | `[protected]`

References OIS::Effect::getNumAxes(), OIS::Effect::replay_delay, and OIS::Effect::replay_length.

Referenced by _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), and _updateRampEffect().

void Win32ForceFeedback::_updateConditionalEffect | ( | const Effect * | effect | ) | `[protected]`

References _setCommonProperties(), _upload(), OIS::Effect::Damper, OIS::Effect::Friction, OIS::Effect::getForceEffect(), OIS::Effect::Inertia, OIS::Effect::Spring, and OIS::Effect::type.

Referenced by upload().

void Win32ForceFeedback::_updateConstantEffect | ( | const Effect * | effect | ) | `[protected]`

References _setCommonProperties(), _upload(), and OIS::Effect::getForceEffect().

Referenced by upload().

void Win32ForceFeedback::_updateCustomEffect | ( | const Effect * | effect | ) | `[protected]`

void Win32ForceFeedback::_updatePeriodicEffect | ( | const Effect * | effect | ) | `[protected]`

References _setCommonProperties(), _upload(), OIS::Effect::getForceEffect(), OIS::Effect::SawToothDown, OIS::Effect::SawToothUp, OIS::Effect::Sine, OIS::Effect::Square, OIS::Effect::Triangle, and OIS::Effect::type.

Referenced by upload().

void Win32ForceFeedback::_updateRampEffect | ( | const Effect * | effect | ) | `[protected]`

References _setCommonProperties(), _upload(), and OIS::Effect::getForceEffect().

Referenced by upload().

void Win32ForceFeedback::_upload | ( | GUID | guid,
|  | DIEFFECT * | diEffect,
|  | const Effect * | effect |
| ) |  |  | `[protected]`

References OIS::Effect::_handle, OIS::E_DeviceFull, OIS::E_General, OIS::E_InvalidParam, mEffectList, mHandles, mJoyStick, and OIS_EXCEPT.

Referenced by _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), and _updateRampEffect().

short OIS::Win32ForceFeedback::getFFAxesNumber | ( |  | ) | `[inline, virtual]`

Remarks:
  Get the number of supported Axes for FF usage

xxx todo - Actually return correct number

Implements OIS::ForceFeedback.

void Win32ForceFeedback::modify | ( | const Effect * | effect | ) | `[virtual]`

Remarks:
  Modifies an effect that is currently playing

Implements OIS::ForceFeedback.

References upload().

void Win32ForceFeedback::remove | ( | const Effect * | effect | ) | `[virtual]`

Remarks:
  Remove the effect from the device

Implements OIS::ForceFeedback.

References OIS::Effect::_handle, and mEffectList.

void Win32ForceFeedback::setAutoCenterMode | ( | bool | auto_on | ) | `[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

Parameters:

  | auto_on | true to turn auto centering on, false to turn off.

Implements OIS::ForceFeedback.

References mJoyStick.

void Win32ForceFeedback::setMasterGain | ( | float | level | ) | `[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.

Parameters:

  | level | A value between 0.0 and 1.0 represent the percentage of gain. 1.0 being the highest possible force level (means no scaling).

Implements OIS::ForceFeedback.

References mJoyStick.

void Win32ForceFeedback::upload | ( | const Effect * | effect | ) | `[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

Implements OIS::ForceFeedback.

References _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), _updateRampEffect(), OIS::Effect::ConditionalForce, OIS::Effect::ConstantForce, OIS::E_NotImplemented, OIS::Effect::force, OIS_EXCEPT, OIS::Effect::PeriodicForce, and OIS::Effect::RampForce.

Referenced by modify().

## Member Data Documentation

EffectList OIS::Win32ForceFeedback::mEffectList`[protected]`

Referenced by _upload(), remove(), and ~Win32ForceFeedback().

int OIS::Win32ForceFeedback::mHandles`[protected]`

Referenced by _upload().

IDirectInputDevice8* OIS::Win32ForceFeedback::mJoyStick`[protected]`

Referenced by _upload(), setAutoCenterMode(), and setMasterGain().

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

- src/ois/win32/Win32ForceFeedback.h
- src/ois/win32/Win32ForceFeedback.cpp