QAxisAccumulatorprocesses velocity or acceleration data from aQAxis. 更多 …
def
scale
()
def
sourceAxis
()
def
sourceAxisType
()
def
value
()
def
velocity
()
def
setScale
(scale)
def
setSourceAxis
(sourceAxis)
def
setSourceAxisType
(sourceAxisType)
def
scaleChanged
(scale)
def
sourceAxisChanged
(sourceAxis)
def
sourceAxisTypeChanged
(sourceAxisType)
def
valueChanged
(value)
def
velocityChanged
(value)
构造新
QAxisAccumulator实例与parent.A
QAxisreports 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 theQAxisas 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 aQFrameActionbut those approached are not ideal as they add more work to the main thread and are inherently imperative. TheQAxisAccumulatorclass allows for this common task to be performed on the Qt 3D backend and be specified in a declarative manner.
PySide2.Qt3DInput.Qt3DInput.
QAxisAccumulator
(
[
parent=None
]
)
¶
- param parent
QNode
构造新
QAxisAccumulator
instance with parent
parent
.
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
SourceAxisType
¶
|
常量 |
描述 |
|---|---|
|
Qt3DInput.QAxisAccumulator.Velocity |
|
|
Qt3DInput.QAxisAccumulator.Acceleration |
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
scale
(
)
¶
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.
另请参阅
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
scaleChanged
(
scale
)
¶
scale
–
float
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
setSourceAxis
(
sourceAxis
)
¶
sourceAxis
–
QAxis
Sets the source axis from which the accumulator should receive values from to
sourceAxis
. How these values are treated is controlled by the
sourceAxisType
and scale properties.
另请参阅
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
setSourceAxisType
(
sourceAxisType
)
¶
sourceAxisType
–
SourceAxisType
Sets how the accumulator treats the values originating from the
sourceAxisType
.
另请参阅
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
sourceAxis
(
)
¶
QAxis
返回
QAxis
for which the accumulator should integrate axis values.
另请参阅
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
sourceAxisChanged
(
sourceAxis
)
¶
sourceAxis
–
QAxis
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
sourceAxisType
(
)
¶
Returns how the accumulator treats the value of the
sourceAxis
.
另请参阅
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
sourceAxisTypeChanged
(
sourceAxisType
)
¶
sourceAxisType
–
SourceAxisType
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
value
(
)
¶
float
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
valueChanged
(
value
)
¶
value
–
float
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
velocity
(
)
¶
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 the
sourceAxisType
is set to Acceleration, the velocity is integrated using the source axis’ value as an acceleration.
PySide2.Qt3DInput.Qt3DInput.QAxisAccumulator.
velocityChanged
(
value
)
¶
value
–
float