sofa::core::objectmodel::JoystickEvent::AxisEvent Class Reference

Implements an event that notifies about axis positions (like analog controls of a joystick). More...

#include <JoystickEvent.h>

Collaboration diagram for sofa::core::objectmodel::JoystickEvent::AxisEvent:

Collaboration graph
[legend]

Public Member Functions

 AxisEvent (const int, const float)
 Constructor.
virtual ~AxisEvent ()
 Default destructor.
Accessors
int getIndex () const
 Retrieves the index of the axis.
float getValue () const
 Retrieves the value of the axis.

Private Attributes

const int m_index
 The index of the axis.
const float m_value
 The value of the xais.

Detailed Description

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].

Definition at line 75 of file JoystickEvent.h.


Constructor & Destructor Documentation

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)

Definition at line 54 of file JoystickEvent.cpp.

virtual sofa::core::objectmodel::JoystickEvent::AxisEvent::~AxisEvent (  )  [inline, virtual]

Default destructor.

Definition at line 91 of file JoystickEvent.h.


Member Function Documentation

int sofa::core::objectmodel::JoystickEvent::AxisEvent::getIndex (  )  const

Retrieves the index of the axis.

Returns:
the axis' index

Definition at line 63 of file JoystickEvent.cpp.

References m_index.

float sofa::core::objectmodel::JoystickEvent::AxisEvent::getValue (  )  const

Retrieves the value of the axis.

Remarks:
Values are always in the range [-1, 1].
Returns:
the axis' value

Definition at line 70 of file JoystickEvent.cpp.

References m_value.


Field Documentation

The index of the axis.

Definition at line 115 of file JoystickEvent.h.

Referenced by getIndex().

The value of the xais.

Definition at line 116 of file JoystickEvent.h.

Referenced by getValue().


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:23:45 2008 for Sofa by  doxygen 1.5.7.1