QAxisAccumulator

QAxisAccumulator processes velocity or acceleration data from a QAxis . More

Inheritance diagram of PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator

Synopsis

Functions

Detailed Description

Constructs a new QAxisAccumulator instance with parent.

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 the 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 QFrameAction but those approached are not ideal as they add more work to the main thread and are inherently imperative. The QAxisAccumulator class allows for this common task to be performed on the Qt 3D backend and be specified in a declarative manner.

class PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator([parent=None])
Parameters

parentPySide6.Qt3DCore.Qt3DCore.QNode

Constructs a new QAxisAccumulator instance with parent parent.

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.SourceAxisType

Constant

Description

Qt3DInput.QAxisAccumulator.Velocity

Qt3DInput.QAxisAccumulator.Acceleration

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.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()

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.scaleChanged(scale)
Parameters

scale – float

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.setScale(scale)
Parameters

scale – float

See also

scale()

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.setSourceAxis(sourceAxis)
Parameters

sourceAxisPySide6.Qt3DInput.Qt3DInput.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.

See also

sourceAxis()

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.setSourceAxisType(sourceAxisType)
Parameters

sourceAxisTypeSourceAxisType

Sets how the accumulator treats the values originating from the sourceAxisType.

See also

sourceAxisType()

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.sourceAxis()
Return type

PySide6.Qt3DInput.Qt3DInput.QAxis

Returns QAxis for which the accumulator should integrate axis values.

See also

setSourceAxis()

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.sourceAxisChanged(sourceAxis)
Parameters

sourceAxisPySide6.Qt3DInput.Qt3DInput.QAxis

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.sourceAxisType()
Return type

SourceAxisType

Returns how the accumulator treats the value of the sourceAxis .

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.sourceAxisTypeChanged(sourceAxisType)
Parameters

sourceAxisTypeSourceAxisType

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.value()
Return type

float

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.valueChanged(value)
Parameters

value – float

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.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 the sourceAxisType is set to Acceleration, the velocity is integrated using the source axis’ value as an acceleration.

PySide6.Qt3DInput.Qt3DInput.QAxisAccumulator.velocityChanged(value)
Parameters

value – float