QAnimationController Class

class Qt3DAnimation::QAnimationController

アニメーションのコントローラークラス。もっと詳しく...

ヘッダー #include <QAnimationController>
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

注意: アニメーションコントローラは内部タイマーを持ちませんが、代わりに、ユーザーがタイムリーにポジションプロパティを更新する責任があります。

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

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)

通知シグナル:

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)

新しい QAnimationController をparent で構築します。

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 を設定します。古いグループはクリアされる。

© 2025 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.