QAxisAccumulator Class
class Qt3DInput::QAxisAccumulatorQAxisAccumulator processes velocity or acceleration data from a QAxis. More...
| Header: | #include <QAxisAccumulator> |
| qmake: | QT += 3dinput |
| Since: | Qt 5.8 |
| Instantiated By: | AxisAccumulator |
| Inherits: | Qt3DCore::QComponent |
This class was introduced in Qt 5.8.
Public Types
| enum | SourceAxisType { Velocity, Acceleration } |
Properties
- value : const float
Public Functions
| float | scale() const |
| Qt3DInput::QAxis * | sourceAxis() const |
| Qt3DInput::QAxisAccumulator::SourceAxisType | sourceAxisType() const |
| float | value() const |
| float | velocity() const |
Public Slots
| void | setScale(float scale) |
| void | setSourceAxis(Qt3DInput::QAxis *sourceAxis) |
| void | setSourceAxisType(QAxisAccumulator::SourceAxisType sourceAxisType) |
Signals
| void | scaleChanged(float scale) |
| void | sourceAxisChanged(Qt3DInput::QAxis *sourceAxis) |
| void | sourceAxisTypeChanged(QAxisAccumulator::SourceAxisType sourceAxisType) |
| void | valueChanged(float value) |
| void | velocityChanged(float value) |
Detailed Description
Constructs a new QAxisAccumulator instance with parent.
A Qt3DInput::QAxis reports the current position of an axis on an input device. When the axis is returned to its neutral position the value of that axis returns to 0. Often, it is required to have the input from an axis control a variable in other ways, for example treating the value from the Qt3DInput::QAxis as a velocity (first derivative with respect to time) or as an acceleration (second derivative with respect to time). This can be done with user code or with a Qt3DLogic::QFrameAction but those approached are not ideal as they add more work to the main thread and are inherently imperative. The Qt3DInput::QAxisAccumulator class allows for this common task to be performed on the Qt 3D backend and be specified in a declarative manner.