Orxonox: OIS::JoyStick Class Reference

# OIS::JoyStick Class Reference

`#include <src/ois/OISJoyStick.h>`

Inheritance diagram for OIS::JoyStick:

List of all members.

## Public Member Functions

JoyStickListener * | getEventCallback () const
const JoyStickState & | getJoyStickState () const
int | getNumberOfComponents (ComponentType cType) const
float | getVector3Sensitivity () const
virtual void | setEventCallback (JoyStickListener *joyListener)
void | setVector3Sensitivity (float degrees=OIS_JOYSTICK_VECTOR3_DEFAULT)
virtual | ~JoyStick ()

## Static Public Attributes

static const int | MAX_AXIS = 32767
| The maximum axis value.
static const int | MIN_AXIS = -32768
| The minimal axis value.

## Protected Member Functions

| JoyStick (const std::string &vendor, bool buffered, int devID, InputManager *creator)

## Protected Attributes

JoyStickListener * | mListener
| The callback listener.
int | mPOVs
| Number of POVs.
int | mSliders
| Number of sliders.
JoyStickState | mState
| The JoyStickState structure (contains all component values).
float | mVector3Sensitivity
| Adjustment factor for orientation vector accuracy.

## Detailed Description

Joystick base class. To be implemented by specific system (ie. DirectX joystick) This class is useful as you remain OS independent using this common interface.

## Constructor & Destructor Documentation

virtual OIS::JoyStick::~JoyStick | ( |  | ) | `[inline, virtual]`

JoyStick::JoyStick | ( | const std::string & | vendor,
|  | bool | buffered,
|  | int | devID,
|  | InputManager * | creator |
| ) |  |  | `[protected]`

## Member Function Documentation

JoyStickListener * JoyStick::getEventCallback | ( |  | ) | const

Remarks:
  Returns currently set callback.. or null

References mListener.

const JoyStickState& OIS::JoyStick::getJoyStickState | ( |  | ) | const`[inline]`

Remarks:
  Returns the state of the joystick - is valid for both buffered and non buffered mode

int JoyStick::getNumberOfComponents | ( | ComponentType | cType | ) | const

Remarks:
  Returns the number of requested components

Parameters:

  | cType | The ComponentType you are interested in knowing about

References OIS::JoyStickState::mAxes, OIS::JoyStickState::mButtons, mPOVs, mSliders, mState, OIS::JoyStickState::mVectors, OIS::OIS_Axis, OIS::OIS_Button, OIS::OIS_POV, OIS::OIS_Slider, and OIS::OIS_Vector3.

float JoyStick::getVector3Sensitivity | ( |  | ) | const

Remarks:
  Returns the sensitivity cutoff for Vector3 Component

References mVector3Sensitivity.

void JoyStick::setEventCallback | ( | JoyStickListener * | joyListener | ) | `[virtual]`

Remarks:
  Register/unregister a JoyStick Listener - Only one allowed for simplicity. If broadcasting is neccessary, just broadcast from the callback you registered.

Parameters:

  | joyListener | Send a pointer to a class derived from JoyStickListener or 0 to clear the callback

References mListener.

Referenced by orxonox::InputManager::_initialiseJoySticks().

void JoyStick::setVector3Sensitivity | ( | float | degrees = `OIS_JOYSTICK_VECTOR3_DEFAULT` | ) |

Remarks:
  Sets a cutoff limit for changes in the Vector3 component for movement to be ignored. Helps reduce much event traffic for frequent small/sensitive changes

Parameters:

  | degrees | The degree under which Vector3 events should be discarded

References mVector3Sensitivity.

## Member Data Documentation

const int OIS::JoyStick::MAX_AXIS = 32767`[static]`

The maximum axis value.

Referenced by OIS::LinuxJoyStick::capture(), and OIS::Win32JoyStick::DIEnumDeviceObjectsCallback().

const int OIS::JoyStick::MIN_AXIS = -32768`[static]`

The minimal axis value.

Referenced by OIS::LinuxJoyStick::capture(), and OIS::Win32JoyStick::DIEnumDeviceObjectsCallback().

JoyStickListener* OIS::JoyStick::mListener`[protected]`

The callback listener.

Referenced by OIS::Win32JoyStick::_changePOV(), OIS::Win32JoyStick::_doButtonClick(), OIS::Win32JoyStick::capture(), OIS::LinuxJoyStick::capture(), getEventCallback(), and setEventCallback().

int OIS::JoyStick::mPOVs`[protected]`

Number of POVs.

Referenced by OIS::Win32JoyStick::_enumerate(), OIS::LinuxJoyStick::_getJoyInfo(), getNumberOfComponents(), and OIS::LinuxJoyStick::LinuxJoyStick().

int OIS::JoyStick::mSliders`[protected]`

Number of sliders.

Referenced by OIS::Win32JoyStick::DIEnumDeviceObjectsCallback(), and getNumberOfComponents().

JoyStickState OIS::JoyStick::mState`[protected]`

The JoyStickState structure (contains all component values).

Referenced by OIS::Win32JoyStick::_changePOV(), OIS::Win32JoyStick::_doButtonClick(), OIS::Win32JoyStick::_enumerate(), OIS::LinuxJoyStick::_getJoyInfo(), OIS::Win32JoyStick::_initialize(), OIS::LinuxJoyStick::_initialize(), OIS::Win32JoyStick::capture(), OIS::LinuxJoyStick::capture(), OIS::Win32JoyStick::DIEnumDeviceObjectsCallback(), getNumberOfComponents(), and OIS::LinuxJoyStick::LinuxJoyStick().

float OIS::JoyStick::mVector3Sensitivity`[protected]`

Adjustment factor for orientation vector accuracy.

Referenced by getVector3Sensitivity(), and setVector3Sensitivity().

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

- src/ois/OISJoyStick.h
- src/ois/OISJoyStick.cpp