 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
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;
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;
383 OIS::JoyStick* m_oisJoystick;
agx::Int32Vector slidersX
Contains the values for all sliders X coordinate. Maximum of 4.
virtual void removeNotification()
Called when this listener has been removed from a JoystickManager.
Pov
Bitmasks indicating the state of the POV button.
agx::Int32Vector slidersX
Contains the values for all sliders X coordinate. Maximum of 4.
Alternative 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.
agx::Int32Vector slidersY
Contains the values for all sliders Y coordinate. Maximum of 4.
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::Int32Vector pov
Represents the value of POV button. Maximum of 4.
agx::BoolVector buttons
Contains the state (in/out) of all buttons.
#define DOXYGEN_START_INTERNAL_BLOCK()
Store the current state of a Joystick/GamePad.
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.
agx::Int32Vector slidersY
Contains the values for all sliders Y coordinate. Maximum of 4.
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::Int32Vector pov
Represents the value of POV button. Maximum of 4.
Class that can be used to listen to events generated by a GamePad or Joystick.
agx::ref_ptr< JoystickListener > JoystickListenerRef
A Joystick/GamePad manager that initializes the connected devices and allows for adding listeners.
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
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.