QAxisAccumulator processes velocity or acceleration data from a QAxis . 更多...
头: | #include <QAxisAccumulator> |
qmake: | QT += 3dinput |
Since: | Qt 5.8 |
实例化: | AxisAccumulator |
继承: | Qt3DCore::QComponent |
enum | SourceAxisType { Velocity, Acceleration } |
|
QAxisAccumulator (Qt3DCore::QNode * parent = nullptr) | |
float | scale () const |
Qt3DInput::QAxis * | sourceAxis () const |
SourceAxisType | sourceAxisType () const |
float | value () const |
float | velocity () const |
void | setScale (float scale ) |
void | setSourceAxis (Qt3DInput::QAxis * sourceAxis ) |
void | setSourceAxisType (QAxisAccumulator::SourceAxisType sourceAxisType ) |
void | scaleChanged (float scale ) |
void | sourceAxisChanged (Qt3DInput::QAxis * sourceAxis ) |
void | sourceAxisTypeChanged (QAxisAccumulator::SourceAxisType sourceAxisType ) |
void | valueChanged (float value ) |
void | velocityChanged (float value ) |
构造新的 QAxisAccumulator 实例与 parent .
QAxisAccumulator processes velocity or acceleration data from a QAxis .
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.
常量 | 值 |
---|---|
Qt3DInput::QAxisAccumulator::Velocity
|
0
|
Qt3DInput::QAxisAccumulator::Acceleration
|
1
|
访问函数:
float | scale () const |
void | setScale (float scale ) |
通知程序信号:
void | scaleChanged (float scale ) |
访问函数:
Qt3DInput::QAxis * | sourceAxis () const |
void | setSourceAxis (Qt3DInput::QAxis * sourceAxis ) |
通知程序信号:
void | sourceAxisChanged (Qt3DInput::QAxis * sourceAxis ) |
访问函数:
SourceAxisType | sourceAxisType () const |
void | setSourceAxisType (QAxisAccumulator::SourceAxisType sourceAxisType ) |
通知程序信号:
void | sourceAxisTypeChanged (QAxisAccumulator::SourceAxisType sourceAxisType ) |
Returns the accumulated (integrated) value.
访问函数:
float | value () const |
通知程序信号:
void | valueChanged (float value ) |
访问函数:
float | velocity () const |
通知程序信号:
void | velocityChanged (float value ) |
构造新的 QAxisAccumulator instance with parent parent .
The amount to scale the axis value by when accumulating. This can be thought of as the maximum velocity or acceleration the axis can control.
Returns the amount the input axis values are scaled by.
注意: Getter 函数对于特性 scale .
另请参阅 setScale ().
[slot]
void
QAxisAccumulator::
setSourceAxisType
(
QAxisAccumulator::SourceAxisType
sourceAxisType
)
Sets how the accumulator treats the values originating from the sourceAxisType .
注意: Setter 函数对于特性 sourceAxisType .
另请参阅 sourceAxisType ().
返回 QAxis for which the accumulator should integrate axis values.
注意: Getter 函数对于特性 sourceAxis .
另请参阅 setSourceAxis ().
Returns how the accumulator treats the value of the sourceAxis .
注意: Getter 函数对于特性 sourceAxisType .
另请参阅 setSourceAxisType ().
Returns the velocity. If the sourceAxisType is set to Velocity this is simply the value of the source axis multiplied by the scale. If the sourceAxisType is set to Acceleration, the velocity is integrated using the source axis' value as an acceleration.
注意: Getter 函数对于特性 velocity .