23 #ifndef OIS_Joystick_H 24 #define OIS_Joystick_H 31 #define OIS_JOYSTICK_VECTOR3_DEFAULT 2.28f 39 static const int Centered = 0x00000000;
40 static const int North = 0x00000001;
41 static const int South = 0x00000010;
42 static const int East = 0x00000100;
43 static const int West = 0x00001000;
44 static const int NorthEast = 0x00000101;
45 static const int SouthEast = 0x00000110;
46 static const int NorthWest = 0x00001001;
47 static const int SouthWest = 0x00001010;
90 for( std::vector<bool>::iterator i = mButtons.begin(),
e = mButtons.end(); i !=
e; ++i )
95 for( std::vector<Axis>::iterator i = mAxes.begin(),
e = mAxes.end(); i !=
e; ++i )
101 for( std::vector<Vector3>::iterator i = mVectors.begin(),
e = mVectors.end(); i !=
e; ++i )
106 for(
int i = 0; i < 4; ++i )
109 mSliders[i].
abX = mSliders[i].
abY = 0;
136 virtual bool buttonPressed(
const JoyStickEvent &arg,
int button ) = 0;
139 virtual bool buttonReleased(
const JoyStickEvent &arg,
int button ) = 0;
142 virtual bool axisMoved(
const JoyStickEvent &arg,
int axis ) = 0;
186 float getVector3Sensitivity()
const;
204 static const int MIN_AXIS = -32768;
207 static const int MAX_AXIS = 32767;
JoyStickListener * mListener
The callback listener.
Definition: OISJoyStick.h:222
Base class of all events.
Definition: OISEvents.h:32
To recieve buffered joystick input, derive a class from this, and implement the methods here...
Definition: OISJoyStick.h:131
std::vector< Axis > mAxes
Represents all the single axes on the device.
Definition: OISJoyStick.h:76
std::vector< Vector3 > mVectors
Represents all Vector type controls the device exports.
Definition: OISJoyStick.h:85
constexpr float e
e
Definition: Math.h:81
Definition: OISPrereqs.h:160
#define _OISExport
Definition: OISPrereqs.h:40
Slider()
Definition: OISJoyStick.h:56
virtual bool povMoved(const JoyStickEvent &arg, int index)
Joystick Event, and povID.
Definition: OISJoyStick.h:149
virtual bool vector3Moved(const JoyStickEvent &arg, int index)
Joystick Event, and Vector3ID.
Definition: OISJoyStick.h:152
::std::string string
Definition: gtest-port.h:756
const JoyStickState & state
Definition: OISJoyStick.h:121
JoyStickEvent(Object *obj, const JoyStickState &st)
Definition: OISJoyStick.h:118
ComponentType
Base type for all device components (button, axis, etc)
Definition: OISPrereqs.h:154
std::vector< bool > mButtons
Represents all the buttons (uses a bitset)
Definition: OISJoyStick.h:73
void clear()
internal method to reset all variables to initial values
Definition: OISJoyStick.h:88
JoyStickState()
Constructor.
Definition: OISJoyStick.h:70
#define OIS_JOYSTICK_VECTOR3_DEFAULT
Definition: OISJoyStick.h:31
Specialised for joystick events.
Definition: OISJoyStick.h:115
virtual ~JoyStickListener()
Definition: OISJoyStick.h:134
float mVector3Sensitivity
Adjustment factor for orientation vector accuracy.
Definition: OISJoyStick.h:225
int abX
true if pushed, false otherwise
Definition: OISJoyStick.h:56
Definition: OISPrereqs.h:159
Base of all device components (button, axis, etc)
Definition: OISPrereqs.h:165
int mSliders
Number of sliders.
Definition: OISJoyStick.h:213
A sliding axis - only used in Win32 Right Now.
Definition: OISJoyStick.h:53
virtual ~JoyStick()
Definition: OISJoyStick.h:162
Represents the state of the joystick All members are valid for both buffered and non buffered mode St...
Definition: OISJoyStick.h:66
const JoyStickState & getJoyStickState() const
Definition: OISJoyStick.h:201
Joystick base class.
Definition: OISJoyStick.h:159
The base class of all input types.
Definition: OISObject.h:32
int direction
Definition: OISJoyStick.h:49
virtual bool sliderMoved(const JoyStickEvent &, int index)
Joystick Event, and sliderID.
Definition: OISJoyStick.h:146
Definition: EventHelpers.h:31
Pov()
Definition: OISJoyStick.h:37
JoyStickState mState
The JoyStickState structure (contains all component values)
Definition: OISJoyStick.h:219
POV / HAT Joystick component.
Definition: OISJoyStick.h:34
virtual ~JoyStickEvent()
Definition: OISJoyStick.h:119
int mPOVs
Number of POVs.
Definition: OISJoyStick.h:216
static const int Centered
Definition: OISJoyStick.h:39
int abY
Definition: OISJoyStick.h:56