このページでは

Qt3DInput::QAxisAccumulator Class

class Qt3DInput::QAxisAccumulator

QAxisAccumulatorは、QAxis からの速度または加速度データを処理します。詳細...

ヘッダー: #include <qaxisaccumulator.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
QML内: AxisAccumulator
継承元: Qt3DCore::QComponent
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

パブリック型

enum SourceAxisType { Velocity, Acceleration }

プロパティ

パブリック関数

QAxisAccumulator(Qt3DCore::QNode *parent = nullptr)
float scale() const
Qt3DInput::QAxis *sourceAxis() const
Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType() const
float value() const
float velocity() const

パブリックスロット

void setScale(float scale)
void setSourceAxis(Qt3DInput::QAxis *sourceAxis)
void setSourceAxisType(Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType)

シグナル

void scaleChanged(float scale)
void sourceAxisChanged(Qt3DInput::QAxis *sourceAxis)
void sourceAxisTypeChanged(Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType)
void valueChanged(float value)
void velocityChanged(float value)

詳細な説明

parent を使用して、新しい QAxisAccumulator インスタンスを構築します。

Qt3DInput::QAxis は、入力デバイス上の軸の現在の位置を報告します。 軸が中立位置に戻ると、その軸の値は 0 に戻ります。多くの場合、軸からの入力を他の方法で変数を制御するために使用する必要があります。例えば、Qt3DInput::QAxis からの値を速度(時間に対する1階微分)や加速度(時間に対する2階微分)として扱うなどです。 これはユーザーコードやQt3DLogic::QFrameAction を使用して実現できますが、これらのアプローチはメインスレッドに余分な負荷をかける上、本質的に命令型であるため理想的ではありません。Qt3DInput::QAxisAccumulator クラスを使用すれば、この一般的なタスクをQt 3D バックエンド上で実行し、宣言的な方法で指定することが可能です。

メンバ型のドキュメント

enum QAxisAccumulator::SourceAxisType

定数定数
Qt3DInput::QAxisAccumulator::Velocity0
Qt3DInput::QAxisAccumulator::Acceleration1

プロパティのドキュメント

scale : float

蓄積時に軸の値をスケーリングするための倍率を保持します。これは、その軸が制御できる最大速度または最大加速度と考えることができます。

アクセス関数:

float scale() const
void setScale(float scale)

通知信号:

void scaleChanged(float scale)

sourceAxis : Qt3DInput::QAxis*

アキュムレータが軸の値を積分すべきQAxisを保持します。

アクセス関数:

Qt3DInput::QAxis *sourceAxis() const
void setSourceAxis(Qt3DInput::QAxis *sourceAxis)

通知信号:

void sourceAxisChanged(Qt3DInput::QAxis *sourceAxis)

sourceAxisType : SourceAxisType

ソース軸からの値をアキュムレータがどのように扱うかを指定する型を保持します。

アクセス関数:

Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType() const
void setSourceAxisType(Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType)

通知信号:

void sourceAxisTypeChanged(Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType)

[read-only] value : float

累積(積分)値を返します。

アクセス関数:

float value() const

通知信号:

void valueChanged(float value)

[read-only] velocity : float

速度を保持します。

「sourceAxisType 」が「Velocity」に設定されている場合、これは単にソース軸の値にスケールを乗じた値となります。「sourceAxisType 」が「Acceleration」に設定されている場合、ソース軸の値を加速度として扱い、速度を積分します。

アクセス関数:

float velocity() const

通知シグナル:

void velocityChanged(float value)

メンバ関数のドキュメント

QAxisAccumulator::QAxisAccumulator(Qt3DCore::QNode *parent = nullptr)

親としてparent を持つ新しいQAxisAccumulatorインスタンスを作成します。

float QAxisAccumulator::scale() const

累積処理を行う際に、軸の値をスケーリングする倍率。これは、その軸が制御できる最大速度または最大加速度と考えることができます。

入力軸の値がスケーリングされる倍率を返します。

注: プロパティ `scale`のゲッター 関数です。

関連項目: setScale()。

[slot] void QAxisAccumulator::setSourceAxis(Qt3DInput::QAxis *sourceAxis)

アキュムレータが値を受け取るソース軸を、sourceAxis に設定します。これらの値の扱い方は、sourceAxisType およびscaleプロパティによって制御されます。

注: プロパティ `sourceAxis`のセッター 関数です。

関連項目: sourceAxis()。

[slot] void QAxisAccumulator::setSourceAxisType(Qt3DInput::QAxisAccumulator::SourceAxisType sourceAxisType)

sourceAxisType から取得された値を、アキュムレータがどのように扱うかを設定します。

注: プロパティ `sourceAxisType`のセッター 関数です。

関連項目: sourceAxisType()。

Qt3DInput::QAxis *QAxisAccumulator::sourceAxis() const

アキュムレータが軸値を積分すべきQAxisを返します。

注: プロパティ sourceAxisのゲッター 関数です。

関連項目: setSourceAxis()。

Qt3DInput::QAxisAccumulator::SourceAxisType QAxisAccumulator::sourceAxisType() const

sourceAxis の値をアキュムレータがどのように扱うかを返します。

注: プロパティ sourceAxisTypeのゲッター 関数です。

関連項目: setSourceAxisType()。

float QAxisAccumulator::velocity() const

速度を返します。sourceAxisType が「Velocity」に設定されている場合、これは単にソース軸の値にスケールを乗じた値となります。sourceAxisType が「Acceleration」に設定されている場合、ソース軸の値を加速度として扱い、速度を積分して算出します。

注: プロパティ `velocity`のゲッター 関数です。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.