- class QAxisAccumulator#
QAxisAccumulator
processes velocity or acceleration data from aQAxis
. More…Synopsis#
Properties#
Methods#
def
__init__()
def
scale()
def
sourceAxis()
def
sourceAxisType()
def
value()
def
velocity()
Slots#
def
setScale()
def
setSourceAxis()
Signals#
def
scaleChanged()
def
valueChanged()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Constructs a new
QAxisAccumulator
instance withparent
.A
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 theQAxis
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 aQFrameAction
but those approached are not ideal as they add more work to the main thread and are inherently imperative. TheQAxisAccumulator
class allows for this common task to be performed on the Qt 3D backend and be specified in a declarative manner.- class SourceAxisType#
Constant
Description
Qt3DInput.QAxisAccumulator.Velocity
Qt3DInput.QAxisAccumulator.Acceleration
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property scaleᅟ: float#
- Access functions:
Signal
scaleChanged()
- Access functions:
- property sourceAxisTypeᅟ: Qt3DInput.QAxisAccumulator.SourceAxisType#
- Access functions:
- property valueᅟ: float#
Returns the accumulated (integrated) value.
- Access functions:
Signal
valueChanged()
- property velocityᅟ: float#
- Access functions:
Signal
velocityChanged()
- __init__([parent=None])#
- Parameters:
parent –
QNode
Constructs a new
QAxisAccumulator
instance with parentparent
.- scale()#
- Return type:
float
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.
See also
setScale()
Getter of property
scaleᅟ
.- scaleChanged(scale)#
- Parameters:
scale – float
Notification signal of property
scaleᅟ
.- setScale(scale)#
- Parameters:
scale – float
See also
scale()
Setter of property
scaleᅟ
.- setSourceAxis(sourceAxis)#
- Parameters:
sourceAxis –
QAxis
Sets the source axis from which the accumulator should receive values from to
sourceAxis
. How these values are treated is controlled by thesourceAxisType
and scale properties.See also
sourceAxis()
Setter of property
sourceAxisᅟ
.- setSourceAxisType(sourceAxisType)#
- Parameters:
sourceAxisType –
SourceAxisType
Sets how the accumulator treats the values originating from the
sourceAxisType
.See also
sourceAxisType()
Setter of property
sourceAxisTypeᅟ
.- sourceAxis()#
- Return type:
QAxis
Returns
QAxis
for which the accumulator should integrate axis values.See also
setSourceAxis()
Getter of property
sourceAxisᅟ
.- sourceAxisChanged(sourceAxis)#
- Parameters:
sourceAxis –
QAxis
Notification signal of property
sourceAxisᅟ
.- sourceAxisType()#
- Return type:
SourceAxisType
Returns how the accumulator treats the value of the
sourceAxis
.See also
setSourceAxisType()
Getter of property
sourceAxisTypeᅟ
.- sourceAxisTypeChanged(sourceAxisType)#
- Parameters:
sourceAxisType –
SourceAxisType
Notification signal of property
sourceAxisTypeᅟ
.- value()#
- Return type:
float
Getter of property
valueᅟ
.- valueChanged(value)#
- Parameters:
value – float
Notification signal of property
valueᅟ
.- velocity()#
- Return type:
float
Returns the velocity. If the
sourceAxisType
is set to Velocity this is simply the value of the source axis multiplied by the scale. If thesourceAxisType
is set to Acceleration, the velocity is integrated using the source axis’ value as an acceleration.Getter of property
velocityᅟ
.- velocityChanged(value)#
- Parameters:
value – float
Notification signal of property
velocityᅟ
.