 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
17 #ifndef AGXSENSOR_JOYSTICK_H
18 #define AGXSENSOR_JOYSTICK_H
53 CENTERED = 0x00000000,
58 NORTHEAST = 0x00000101,
59 SOUTHEAST = 0x00000110,
60 NORTHWEST = 0x00001001,
61 SOUTHWEST = 0x00001010
80 State(
const OIS::JoyStickState& oisState );
92 virtual bool buttonChanged(
const State &arg,
int button,
bool down ) =0;
99 virtual bool axisMoved(
const State &arg,
int axis ) =0;
106 virtual bool povMoved(
const State &arg,
int pov ) =0;
113 virtual bool sliderMoved(
const State &arg,
int index) =0;
126 agx::Real normalize(
int axisValue )
const;
128 State getState()
const;
137 OIS::JoyStick* m_oisJoystick;
140 bool m_forceFeedbackFound;
145 class JoystickManager;
152 CENTERED = 0x00000000,
157 NORTHEAST = 0x00000101,
158 SOUTHEAST = 0x00000110,
159 NORTHWEST = 0x00001001,
160 SOUTHWEST = 0x00001010
211 : m_mask( ALL ), m_manager( nullptr ) {}
218 : m_mask( mask ), m_manager( nullptr ) {}
331 bool valid()
const {
return m_initialized; }
348 agx::Real normalize(
int axisValue )
const;
383 OIS::JoyStick* m_oisJoystick;
virtual void removeNotification()
Called when this listener has been removed from a JoystickManager.
Pov
Bitmasks indicating the state of the POV button.
Joystick interface for gamepads etc.
agx::HashVector< JoystickListener *, JoystickListenerRef > JoystickListenerContainer
virtual void pre(const agx::TimeStamp &time)
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
agx::ref_ptr< JoystickManager > JoystickManagerRef
agx::Int32Vector axes
Contains the values for all axes.
Derive from this class to implement a listener for simulation step events.
virtual ~JoystickListener()
const JoystickManager * getManager() const
#define DOXYGEN_END_INTERNAL_BLOCK()
The agxSensor namespace contains drivers for reading for devices such as Gamepad.
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
#define DOXYGEN_START_INTERNAL_BLOCK()
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
Vector containing 'raw' data.
virtual void addNotification()
Called when this listener has been added to a JoystickManager.
Smart pointer for handling referenced counted objects.
Simulation * getSimulation()
agx::Int32Vector axes
Contains the values for all axes.
bool inSimulation() const
JoystickManager * getManager()
Class for storing a Joystick state.
Pov
Bit masks indicating the state of the POV button.
virtual void addNotification()
Called when this listener is added to the simulation.
Base class providing referencing counted objects.
void setMask(int mask)
Assign new callback mask to this listener.
agx::ref_ptr< JoystickListener > JoystickListenerRef
void AGXPHYSICS_EXPORT init()
Initialize agx.
JoystickListener()
Default constructor for a joystick listener.
JoystickListener(int mask)
Create joystick listener given a callback mask (default ALL).
virtual void removeNotification()
Called when this listener is removed from the simulation.