51 static const int NUM_AXES = 4;
55 CENTERED = 0x00000000,
60 NORTHEAST = 0x00000101,
61 SOUTHEAST = 0x00000110,
62 NORTHWEST = 0x00001001,
63 SOUTHWEST = 0x00001010
82 State(
const OIS::JoyStickState& oisState );
94 virtual bool buttonChanged(
const State &arg,
int button,
bool down ) =0;
101 virtual bool axisMoved(
const State &arg,
int axis ) =0;
108 virtual bool povMoved(
const State &arg,
int pov ) =0;
115 virtual bool sliderMoved(
const State &arg,
int index) =0;
128 agx::Real normalize(
int axisValue )
const;
130 State getState()
const;
134 virtual void addNotification();
135 virtual void removeNotification();
139 OIS::JoyStick* m_oisJoystick;
142 bool m_forceFeedbackFound;
155 static int const NUM_AXES = Joystick::State::NUM_AXES;
159 CENTERED = 0x00000000,
164 NORTHEAST = 0x00000101,
165 SOUTHEAST = 0x00000110,
166 NORTHWEST = 0x00001001,
167 SOUTHWEST = 0x00001010
217 : m_mask( ALL ), m_manager( nullptr ) {}
224 : m_mask( mask ), m_manager( nullptr ) {}
331 bool valid()
const {
return m_initialized; }
348 agx::Real normalize(
int axisValue )
const;
368 virtual void addNotification();
373 virtual void removeNotification();
381 JoystickListenerContainer m_listeners;
382 JoystickListenerContainer m_listenersToBeRemoved;
383 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 Dynamics API including thread resources and must be executed before using the AGX API...
const JoystickManager * getManager() const
JoystickListener()
Default constructor for a joystick listener.
Derive from this class to implement a listener for simulation step events.
agx::Int32Vector slidersY
Contains the values for all sliders Y coordinate. Maximum of 4.
Alternative 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::Int32Vector slidersX
Contains the values for all sliders X coordinate. Maximum of 4.
agx::ref_ptr< JoystickManager > JoystickManagerRef
Class for storing a Joystick state.
virtual ~JoystickListener()
Base class providing referencing counted objects.
agx::Int32Vector slidersY
Contains the values for all sliders Y coordinate. Maximum of 4.
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()
agx::Int32Vector slidersX
Contains the values for all sliders X coordinate. Maximum of 4.
agx::Int32Vector pov
Represents the value of POV button. Maximum of 4.
Pov
Bitmasks indicating the state of the POV button.
agx::Int32Vector pov
Represents the value of POV button. Maximum of 4.
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
#define DOXYGEN_END_INTERNAL_BLOCK()
Store the current state of a Joystick/GamePad.
#define DOXYGEN_START_INTERNAL_BLOCK()
Class that can be used to listen to events generated by a GamePad or Joystick.
A Joystick/GamePad manager that initializes the connected devices and allows for adding listeners...
JoystickListener(int mask)
Create joystick listener given a callback mask (default ALL).