Orxonox
0.0.5 Codename: Arcturus
|
Wraps around an OIS::JoyStick and forwards the input events to a list of input states. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/input/JoyStick.h>
Public Member Functions | |
JoyStick (unsigned int id, OIS::InputManager *oisInputManager) | |
Assigns a generated ID string and loads the calibration (if present) More... | |
~JoyStick ()=default | |
const std::string & | getDeviceName () const |
Returns the name generated from the number of knobs and the device name. More... | |
void | setConfigValues () |
Public Member Functions inherited from orxonox::Configurable | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
Public Member Functions inherited from orxonox::Listable | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
Public Member Functions inherited from orxonox::Identifiable | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
Public Member Functions inherited from orxonox::InputDeviceTemplated< JoyStickTraits > | |
InputDeviceTemplated (unsigned int id, OIS::InputManager *oisInputManager) | |
Creates the OIS device. More... | |
virtual | ~InputDeviceTemplated () |
Destroys the OIS device. More... | |
virtual void | clearBuffers () override |
Clears the list of pressed buttons and calls the derived class's method. More... | |
virtual std::string | getClassName () const override |
Returns the device class (derived) name as string. More... | |
OISDeviceClass * | getOISDevice () |
virtual void | update (const Clock &time) override |
Captures OIS events (which then get distributed to the derived class) and creates the button held events. More... | |
Public Member Functions inherited from orxonox::InputDevice | |
InputDevice (unsigned int id) | |
Only resets the members. More... | |
virtual | ~InputDevice ()=default |
unsigned int | getDeviceID () const |
Returns the ID of the device (the same as in InputDeviceEnumerator for mouse and keyboard) More... | |
std::vector< InputState * > & | getStateListRef () |
Returns a reference to the internal input state vector. Use with care! More... | |
bool | isCalibrating () const |
Tells whether the device is in calibration mode. More... | |
void | startCalibration () |
Start calibrating (only useful for joy sticks) More... | |
void | stopCalibration () |
Stop calibrating and evaluate the data (only useful for joy sticks) More... | |
Public Member Functions inherited from OIS::JoyStickListener | |
virtual | ~JoyStickListener () |
Private Types | |
typedef InputDeviceTemplated< JoyStickTraits > | super |
Super class alias. More... | |
Private Member Functions | |
virtual bool | axisMoved (const OIS::JoyStickEvent &arg, int axis) override |
OIS joy stick axis event handler. More... | |
virtual bool | buttonPressed (const OIS::JoyStickEvent &arg, int button) override |
OIS event handler. More... | |
virtual bool | buttonReleased (const OIS::JoyStickEvent &arg, int button) override |
OIS event handler. More... | |
void | calibrationFileCallback () |
Callback for the joy stick calibration config file. More... | |
virtual void | calibrationStarted () override |
Called by InputDevice when calibration mode has started. More... | |
virtual void | calibrationStopped () override |
Called by InputDevice when calibration mode has stopped. More... | |
void | clearBuffersImpl () |
Resets the pov states. More... | |
void | evaluateCalibration () |
Evaluates the accumulated values during calibration. More... | |
void | fireAxis (int axis, int value) |
Generic method to forward axis events. More... | |
virtual bool | povMoved (const OIS::JoyStickEvent &arg, int id) override |
A POV is the big button that can point in all directions (but only in one at once) More... | |
virtual bool | sliderMoved (const OIS::JoyStickEvent &arg, int id) override |
A Slider always has an X and an Y direction! More... | |
virtual bool | vector3Moved (const OIS::JoyStickEvent &arg, int id) override |
OIS event handler (don't remove that because of OIS version issues!) More... | |
Static Private Member Functions | |
static std::string | getClassNameImpl () |
Returns the class name as string. More... | |
Private Attributes | |
std::string | calibrationFilename_ |
Joy stick calibration ini filename. More... | |
std::vector< int > | configMaxValues_ |
Config file stored maximum axis values. More... | |
std::vector< int > | configMinValues_ |
Config file stored minimum axis values. More... | |
std::vector< int > | configZeroValues_ |
Config file stored axis values when the knob is in the middle. More... | |
std::string | deviceName_ |
Name generated by the number of knobs and the device name. More... | |
float | negativeCoeffs_ [24] |
Maps the positive part of an axis to a 0.0 to 1.0 floating range. More... | |
float | positiveCoeffs_ [24] |
Maps the negative part of an axis to a 0.0 to 1.0 floating range. More... | |
int | povStates_ [4] |
Internal states for the POVs. More... | |
int | sliderStates_ [4][2] |
Internal states for the Sliders (each slider has X and Y!) More... | |
int | zeroValues_ [24] |
Axes values when the knob is in the middle. More... | |
Static Private Attributes | |
static std::vector< std::string > | deviceNames_s |
Contains a list of all names to avoid duplicates. More... | |
static const unsigned int | sliderAxes_s = 8 |
Friends | |
class | InputDeviceTemplated< JoyStickTraits > |
Additional Inherited Members | |
Protected Member Functions inherited from orxonox::InputDeviceTemplated< JoyStickTraits > | |
ORX_FORCEINLINE void | buttonPressed (ButtonTypeParam button) |
Common code for all button pressed events (updates pressed buttons list and calls the input states) More... | |
ORX_FORCEINLINE void | buttonReleased (ButtonTypeParam button) |
Common code for all button released events (updates pressed buttons list and calls the input states) More... | |
Protected Attributes inherited from orxonox::InputDeviceTemplated< JoyStickTraits > | |
OISDeviceClass * | oisDevice_ |
Managed pointer to the OIS device. More... | |
Protected Attributes inherited from orxonox::InputDevice | |
std::vector< InputState * > | inputStates_ |
List of all input states that receive events from this device. More... | |
Wraps around an OIS::JoyStick and forwards the input events to a list of input states.
The class also supports joy stick calibration and stores the values in an ini-file.
|
private |
Super class alias.
orxonox::JoyStick::JoyStick | ( | unsigned int | id, |
OIS::InputManager * | oisInputManager | ||
) |
Assigns a generated ID string and loads the calibration (if present)
|
default |
|
overrideprivatevirtual |
OIS joy stick axis event handler.
Implements OIS::JoyStickListener.
|
inlineoverrideprivatevirtual |
OIS event handler.
Implements OIS::JoyStickListener.
|
inlineoverrideprivatevirtual |
OIS event handler.
Implements OIS::JoyStickListener.
|
private |
Callback for the joy stick calibration config file.
|
overrideprivatevirtual |
Called by InputDevice when calibration mode has started.
Reimplemented from orxonox::InputDevice.
|
overrideprivatevirtual |
Called by InputDevice when calibration mode has stopped.
Reimplemented from orxonox::InputDevice.
|
private |
Resets the pov states.
|
private |
Evaluates the accumulated values during calibration.
|
private |
Generic method to forward axis events.
|
inlinestaticprivate |
Returns the class name as string.
|
inline |
Returns the name generated from the number of knobs and the device name.
|
overrideprivatevirtual |
A POV is the big button that can point in all directions (but only in one at once)
Reimplemented from OIS::JoyStickListener.
|
overrideprivatevirtual |
A Slider always has an X and an Y direction!
Reimplemented from OIS::JoyStickListener.
|
inlineoverrideprivatevirtual |
OIS event handler (don't remove that because of OIS version issues!)
Reimplemented from OIS::JoyStickListener.
|
friend |
|
private |
Joy stick calibration ini filename.
|
private |
Config file stored maximum axis values.
|
private |
Config file stored minimum axis values.
|
private |
Config file stored axis values when the knob is in the middle.
|
private |
Name generated by the number of knobs and the device name.
|
staticprivate |
Contains a list of all names to avoid duplicates.
Maximum number of slider axes
|
private |
Maps the positive part of an axis to a 0.0 to 1.0 floating range.
|
private |
Maps the negative part of an axis to a 0.0 to 1.0 floating range.
|
private |
Internal states for the POVs.
|
staticprivate |
|
private |
Internal states for the Sliders (each slider has X and Y!)
|
private |
Axes values when the knob is in the middle.