Qt3DAnimation::QAnimationController Class
class Qt3DAnimation::QAnimationControllerアニメーション用のコントローラクラス。詳細...
| ヘッダー: | #include <qanimationcontroller.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| QML内: | AnimationController |
| 継承元: | QObject |
| ステータス: | テクノロジープレビュー |
このクラスはテクノロジープレビュー段階にあり、変更される可能性があります。
プロパティ
|
|
パブリック関数
| QAnimationController(QObject *parent = nullptr) | |
| int | activeAnimationGroup() const |
| void | addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup) |
| QList<Qt3DAnimation::QAnimationGroup *> | animationGroupList() |
| Qt3DCore::QEntity * | entity() const |
| int | getAnimationIndex(const QString &name) const |
| Qt3DAnimation::QAnimationGroup * | getGroup(int index) const |
| float | position() const |
| float | positionOffset() const |
| float | positionScale() const |
| bool | recursive() const |
| void | removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup) |
| void | setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups) |
パブリックスロット
| void | setActiveAnimationGroup(int index) |
| void | setEntity(Qt3DCore::QEntity *entity) |
| void | setPosition(float position) |
| void | setPositionOffset(float offset) |
| void | setPositionScale(float scale) |
| void | setRecursive(bool recursive) |
シグナル
| void | activeAnimationGroupChanged(int index) |
| void | entityChanged(Qt3DCore::QEntity *entity) |
| void | positionChanged(float position) |
| void | positionOffsetChanged(float offset) |
| void | positionScaleChanged(float scale) |
| void | recursiveChanged(bool recursive) |
詳細な説明
Qt3DAnimation::QAnimationController このクラスは、アニメーションの選択と再生を制御します。 このクラスを使用すると、Qt3DCore::QEntityツリーからすべてのアニメーションを検索し、同じ名前のアニメーションからQAnimationGroups を作成することができます。ユーザーは、アクティブなアニメーションを設定することで、アニメーションコントローラによって現在制御されているアニメーショングループを選択できます。その後、指定された位置値にpositionScale およびpositionOffset の値を乗算・オフセット処理を施し、そのアニメーショングループにアニメーションの位置が反映されます。
注: アニメーションコントローラーには 内部タイマーは備わっておらず、代わりにユーザーが適時にpositionプロパティを更新する必要があります。
プロパティのドキュメント
activeAnimationGroup : int
現在アクティブなアニメーショングループを保持します。
アクセス関数:
| int | activeAnimationGroup() const |
| void | setActiveAnimationGroup(int index) |
通知シグナル:
| void | activeAnimationGroupChanged(int index) |
entity : Qt3DCore::QEntity*
エンティティのアニメーションが収集・グループ化される対象を保持します。コントローラーにすでにアニメーションが保持されている場合、それらはクリアされます。
アクセス関数:
| Qt3DCore::QEntity * | entity() const |
| void | setEntity(Qt3DCore::QEntity *entity) |
Notifierシグナル:
| void | entityChanged(Qt3DCore::QEntity *entity) |
position : float
アニメーションの現在の位置を保持します。位置が設定されると、positionScale/positionOffset によってスケーリングおよびオフセットが適用され、アクティブなアニメーショングループに反映されます。
アクセス関数:
| float | position() const |
| void | setPosition(float position) |
通知シグナル:
| void | positionChanged(float position) |
positionOffset : float
アニメーションの位置オフセットを保持します。
アクセス関数:
| float | positionOffset() const |
| void | setPositionOffset(float offset) |
通知シグナル:
| void | positionOffsetChanged(float offset) |
positionScale : float
アニメーションの位置スケールを保持します。
アクセス関数:
| float | positionScale() const |
| void | setPositionScale(float scale) |
通知シグナル:
| void | positionScaleChanged(float scale) |
recursive : bool
エンティティからアニメーションを収集する際に、エンティティツリーを再帰的に検索するかどうかを指定します。true に設定すると、そのエンティティの子エンティティからもアニメーションが検索されます。false に設定すると、コントローラーに渡されたエンティティのみが検索対象となります。
アクセス関数:
| bool | recursive() const |
| void | setRecursive(bool recursive) |
Notifierシグナル:
| void | recursiveChanged(bool recursive) |
メンバ関数のドキュメント
QAnimationController::QAnimationController(QObject *parent = nullptr)
parent を使用して、新しい QAnimationController を作成します。
void QAnimationController::addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
指定されたanimationGroup をコントローラーに追加します。
QList<Qt3DAnimation::QAnimationGroup *> QAnimationController::animationGroupList()
コントローラーが現在保持しているアニメーショングループのリストを返します。
[invokable] int QAnimationController::getAnimationIndex(const QString &name) const
name を持つアニメーションのインデックスを返します。指定された名前のAnimationGroup が見つからない場合は -1 を返します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] Qt3DAnimation::QAnimationGroup *QAnimationController::getGroup(int index) const
指定されたindex を持つAnimationGroup を返します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
void QAnimationController::removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
指定されたanimationGroup をコントローラから削除します。
void QAnimationController::setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups)
コントローラーのanimationGroups を設定します。既存のグループは削除されます。
© 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.