17 #ifndef AGXSENSOR_JOYSTICK_H 18 #define AGXSENSOR_JOYSTICK_H 54 CENTERED = 0x00000000,
59 NORTHEAST = 0x00000101,
60 SOUTHEAST = 0x00000110,
61 NORTHWEST = 0x00001001,
62 SOUTHWEST = 0x00001010
81 State(
const OIS::JoyStickState& oisState );
93 virtual bool buttonChanged(
const State &arg,
int button,
bool down ) =0;
100 virtual bool axisMoved(
const State &arg,
int axis ) =0;
107 virtual bool povMoved(
const State &arg,
int pov ) =0;
114 virtual bool sliderMoved(
const State &arg,
int index) =0;
127 agx::Real normalize(
int axisValue )
const;
129 State getState()
const;
133 virtual void addNotification();
134 virtual void removeNotification();
138 OIS::JoyStick* m_oisJoystick;
141 bool m_forceFeedbackFound;
153 CENTERED = 0x00000000,
158 NORTHEAST = 0x00000101,
159 SOUTHEAST = 0x00000110,
160 NORTHWEST = 0x00001001,
161 SOUTHWEST = 0x00001010
212 : m_mask( ALL ), m_manager( nullptr ) {}
219 : m_mask( mask ), m_manager( nullptr ) {}
332 bool valid()
const {
return m_initialized; }
349 agx::Real normalize(
int axisValue )
const;
369 virtual void addNotification();
374 virtual void removeNotification();
382 JoystickListenerContainer m_listeners;
383 JoystickListenerContainer m_listenersToBeRemoved;
384 OIS::JoyStick* m_oisJoystick;
bool inSimulation() const
agx::ref_ptr< JoystickListener > JoystickListenerRef
agx::Int32Vector axes
Contains the values for all axes.
void AGXPHYSICS_EXPORT init()
Initialize agx.
const JoystickManager * getManager() const
JoystickListener()
Default constructor for a joystick listener.
Derive from this class to implement a listener for simulation Step events.
Joystick interface for gamepads etc.
virtual void removeNotification()
Called when this listener has been removed from a JoystickManager.
agx::HashVector< JoystickListener *, JoystickListenerRef > JoystickListenerContainer
virtual void addNotification()
Called when this listener has been added to a JoystickManager.
agx::ref_ptr< JoystickManager > JoystickManagerRef
Class for storing a Joystick state.
virtual ~JoystickListener()
Base class providing referencing counted objects.
agx::Int32Vector axes
Contains the values for all axes.
Vector containing 'raw' data.
void setMask(int mask)
Assign new callback mask to this listener.
Pov
Bit masks indicating the state of the POV button.
The agxSensor namespace contains drivers for reading for devices such as Gamepad. ...
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
Smart pointer for handling referenced counted objects.
JoystickManager * getManager()
Pov
Bitmasks indicating the state of the POV button.
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
JoystickListener(int mask)
Create joystick listener given a callback mask (default ALL).