OIS::JoyStick Class Reference

#include <src/ois/OISJoyStick.h>

Inheritance diagram for OIS::JoyStick:

OIS::Object OIS::LinuxJoyStick OIS::Win32JoyStick

List of all members.

Public Member Functions

JoyStickListenergetEventCallback () const
const JoyStickStategetJoyStickState () 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

JoyStickListenermListener
 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]

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

int OIS::JoyStick::mPOVs [protected]

int OIS::JoyStick::mSliders [protected]

Adjustment factor for orientation vector accuracy.

Referenced by getVector3Sensitivity(), and setVector3Sensitivity().


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

Generated on Tue Jul 28 16:22:17 2009 for Orxonox by  doxygen 1.5.6