OIS  1.5
Object-oriented Input System
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OIS::JoyStick Class Reference

#include <OISJoyStick.h>

Inheritance diagram for OIS::JoyStick:
OIS::Object

Public Member Functions

virtual ~JoyStick ()
 
int getNumberOfComponents (ComponentType cType) const
 
void setVector3Sensitivity (float degrees=OIS_JOYSTICK_VECTOR3_DEFAULT)
 
float getVector3Sensitivity () const
 
virtual void setEventCallback (JoyStickListener *joyListener)
 
JoyStickListenergetEventCallback () const
 
const JoyStickStategetJoyStickState () const
 
- Public Member Functions inherited from OIS::Object
virtual ~Object ()
 
Type type () const
 
const std::string & vendor () const
 
virtual bool buffered () const
 
InputManagergetCreator () const
 
virtual void setBuffered (bool buffered)=0
 
virtual void capture ()=0
 
virtual int getID () const
 
virtual InterfacequeryInterface (Interface::IType type)=0
 
virtual void _initialize ()=0
 

Static Public Attributes

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

Protected Member Functions

 JoyStick (const std::string &vendor, bool buffered, int devID, InputManager *creator)
 
- Protected Member Functions inherited from OIS::Object
 Object (const std::string &vendor, Type iType, bool buffered, int devID, InputManager *creator)
 

Protected Attributes

int mSliders
 Number of sliders. More...
 
int mPOVs
 Number of POVs. More...
 
JoyStickState mState
 The JoyStickState structure (contains all component values) More...
 
JoyStickListenermListener
 The callback listener. More...
 
float mVector3Sensitivity
 Adjustment factor for orientation vector accuracy. More...
 
- Protected Attributes inherited from OIS::Object
std::string mVendor
 Vendor name if applicable/known. More...
 
Type mType
 Type of controller object. More...
 
bool mBuffered
 Buffered flag. More...
 
int mDevID
 Not fully implemented yet. More...
 
InputManagermCreator
 The creator who created this object. More...
 

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

◆ ~JoyStick()

virtual OIS::JoyStick::~JoyStick ( )
inlinevirtual

◆ JoyStick()

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

Member Function Documentation

◆ getEventCallback()

JoyStickListener * JoyStick::getEventCallback ( ) const
Remarks
Returns currently set callback.. or null

◆ getJoyStickState()

const JoyStickState& OIS::JoyStick::getJoyStickState ( ) const
inline
Remarks
Returns the state of the joystick - is valid for both buffered and non buffered mode

◆ getNumberOfComponents()

int JoyStick::getNumberOfComponents ( ComponentType  cType) const
Remarks
Returns the number of requested components
Parameters
cTypeThe ComponentType you are interested in knowing about

◆ getVector3Sensitivity()

float JoyStick::getVector3Sensitivity ( ) const
Remarks
Returns the sensitivity cutoff for Vector3 Component

◆ setEventCallback()

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
joyListenerSend a pointer to a class derived from JoyStickListener or 0 to clear the callback

◆ setVector3Sensitivity()

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
degreesThe degree under which Vector3 events should be discarded

Member Data Documentation

◆ MAX_AXIS

const int OIS::JoyStick::MAX_AXIS = 32767
static

The maximum axis value.

◆ MIN_AXIS

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

The minimal axis value.

◆ mListener

JoyStickListener* OIS::JoyStick::mListener
protected

The callback listener.

◆ mPOVs

int OIS::JoyStick::mPOVs
protected

Number of POVs.

◆ mSliders

int OIS::JoyStick::mSliders
protected

Number of sliders.

◆ mState

JoyStickState OIS::JoyStick::mState
protected

The JoyStickState structure (contains all component values)

◆ mVector3Sensitivity

float OIS::JoyStick::mVector3Sensitivity
protected

Adjustment factor for orientation vector accuracy.


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