Orxonox
0.0.5 Codename: Arcturus
|
Heavily templated base class for all three input devices. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/CorePrereqs.h>
Public Member Functions | |
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... | |
![]() | |
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... | |
Protected Member Functions | |
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... | |
![]() | |
virtual void | calibrationStarted () |
To be ovrridden by the subclass. More... | |
virtual void | calibrationStopped () |
To be ovrridden by the subclass. More... | |
Protected Attributes | |
OISDeviceClass * | oisDevice_ |
Managed pointer to the OIS device. More... | |
![]() | |
std::vector< InputState * > | inputStates_ |
List of all input states that receive events from this device. More... | |
Private Types | |
typedef Traits::ButtonType | ButtonType |
typedef Traits::ButtonTypeParam | ButtonTypeParam |
typedef Traits::DeviceClass | DeviceClass |
typedef Traits::OISDeviceClass | OISDeviceClass |
Private Member Functions | |
void | clearBuffersImpl () |
< Fallback dummy function for static polymorphism More... | |
ButtonType & | getButtonEventArg (ButtonType &button) |
void | updateImpl (const Clock &time) |
Fallback dummy function for static polymorphism. More... | |
Private Attributes | |
OIS::InputManager * | oisInputManager_ |
Pointer to the OIS InputManager that can create and destroy devices. More... | |
std::vector< ButtonType > | pressedButtons_ |
List of all buttons that are currently pressed down. More... | |
Static Private Attributes | |
static const OIS::Type | OISDeviceValue = Traits::OISDeviceValue |
Heavily templated base class for all three input devices.
The purpose of this class is not to provide an interface but rather to reduce code redundancy. This concerns device creation and destruction as well as common code for button events (press, release, hold).
In order to derive from this class you have to supply it with a struct as template parameter that contains the necessary type traits.
|
private |
|
private |
|
private |
|
private |
|
inline |
Creates the OIS device.
|
inlinevirtual |
Destroys the OIS device.
|
inlineprotected |
Common code for all button pressed events (updates pressed buttons list and calls the input states)
|
inlineprotected |
Common code for all button released events (updates pressed buttons list and calls the input states)
|
inlineoverridevirtual |
Clears the list of pressed buttons and calls the derived class's method.
Implements orxonox::InputDevice.
|
inlineprivate |
< Fallback dummy function for static polymorphism
Fallback dummy function for static polymorphism
|
inlineprivate |
|
inlineoverridevirtual |
Returns the device class (derived) name as string.
Implements orxonox::InputDevice.
|
inline |
|
inlineoverridevirtual |
Captures OIS events (which then get distributed to the derived class) and creates the button held events.
Implements orxonox::InputDevice.
|
inlineprivate |
Fallback dummy function for static polymorphism.
|
protected |
Managed pointer to the OIS device.
|
staticprivate |
|
private |
Pointer to the OIS InputManager that can create and destroy devices.
|
private |
List of all buttons that are currently pressed down.