#include <JoystickEvent.h>
Implements an event that notifies about axis positions (like analog controls of a joystick). The axis position is normalized so values are always in the range [-1, 1].
More...
Implements an event that notifies about axis positions (like analog controls of a joystick). The axis position is normalized so values are always in the range [-1, 1].
◆ AxisEvent()
sofa::core::objectmodel::JoystickEvent::AxisEvent::AxisEvent |
( |
const int |
index, |
|
|
const float |
value |
|
) |
| |
Constructor.
- Parameters
-
index | axis' index |
value | axis' value (must be in the range [-1, 1]) |
- Precondition
- (value >= -1.f) && (value <= 1.f)
◆ ~AxisEvent()
sofa::core::objectmodel::JoystickEvent::AxisEvent::~AxisEvent |
( |
| ) |
|
|
virtual |
◆ getClassName()
virtual const char* sofa::core::objectmodel::JoystickEvent::AxisEvent::getClassName |
( |
| ) |
const |
|
inlinevirtual |
◆ getIndex()
int sofa::core::objectmodel::JoystickEvent::AxisEvent::getIndex |
( |
| ) |
const |
Retrieves the index of the axis.
- Returns
- the axis' index
◆ getValue()
float sofa::core::objectmodel::JoystickEvent::AxisEvent::getValue |
( |
void |
| ) |
const |
Retrieves the value of the axis.
- Returns
- the axis' value