Sur cette page

Qt3DAnimation::QAnimationController Class

class Qt3DAnimation::QAnimationController

Classe de contrôleur pour les animations. Plus d'informations...

En-tête : #include <QAnimationController>
CMake : find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake : QT += 3danimation
En QML : AnimationController
Hérite : QObject
Statut : Déclassé

Propriétés

Fonctions publiques

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)

Emplacements publics

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)

Signaux

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)

Description détaillée

Qt3DAnimation::QAnimationController Cette classe contrôle la sélection et la lecture des animations. Cette classe peut être utilisée pour rechercher toutes les animations dans l'arbre Qt3DCore::QEntity et créer QAnimationGroups à partir des animations portant le même nom. L'utilisateur peut sélectionner le groupe d'animation actuellement contrôlé par le contrôleur d'animation en définissant l'animation active. La position de l'animation est alors propagée à ce groupe après mise à l'échelle et décalage de la valeur de position fournie avec les valeurs positionScale et positionOffset.

Remarque : le contrôleur d'animation n'a pas de minuterie interne, c'est l'utilisateur qui est responsable de la mise à jour de la propriété de position en temps voulu.

Documentation sur les propriétés

activeAnimationGroup : int

Contient le groupe d'animation actuellement actif.

Fonctions d'accès :

int activeAnimationGroup() const
void setActiveAnimationGroup(int index)

Signal de notification :

void activeAnimationGroupChanged(int index)

entity : Qt3DCore::QEntity*

Contient l'entité à partir de laquelle les animations sont rassemblées et regroupées. Si le contrôleur contient déjà des animations, celles-ci sont effacées.

Fonctions d'accès :

Qt3DCore::QEntity *entity() const
void setEntity(Qt3DCore::QEntity *entity)

Signal de notification :

void entityChanged(Qt3DCore::QEntity *entity)

position : float

Détient la position actuelle de l'animation. Lorsque la position est définie, elle est mise à l'échelle et décalée avec positionScale/positionOffset et propagée au groupe d'animation actif.

Fonctions d'accès :

float position() const
void setPosition(float position)

Signal de notification :

void positionChanged(float position)

positionOffset : float

Détient le décalage de position de l'animation.

Fonctions d'accès :

float positionOffset() const
void setPositionOffset(float offset)

Signal de notification :

void positionOffsetChanged(float offset)

positionScale : float

Détient l'échelle de position de l'animation.

Fonctions d'accès :

float positionScale() const
void setPositionScale(float scale)

Signal de notification :

void positionScaleChanged(float scale)

recursive : bool

Indique si l'arbre de l'entité doit être parcouru de manière récursive lors de la collecte des animations de l'entité. Si la valeur est "true", les animations sont également recherchées dans les entités enfants de l'entité. S'il vaut false, seule l'entité transmise au contrôleur est recherchée.

Fonctions d'accès :

bool recursive() const
void setRecursive(bool recursive)

Signal Notificateur :

void recursiveChanged(bool recursive)

Fonction membre Documentation

QAnimationController::QAnimationController(QObject *parent = nullptr)

Construit un nouveau QAnimationController avec parent.

void QAnimationController::addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)

Ajoute le site animationGroup au contrôleur.

QList<Qt3DAnimation::QAnimationGroup *> QAnimationController::animationGroupList()

Renvoie la liste des groupes d'animation que le contrôleur détient actuellement.

[invokable] int QAnimationController::getAnimationIndex(const QString &name) const

Renvoie l'index de l'animation avec name. Retourne -1 si aucun AnimationGroup portant le nom donné n'est trouvé.

Remarque : cette fonction peut être invoquée via le système de méta-objets et à partir de QML. Voir Q_INVOKABLE.

[invokable] Qt3DAnimation::QAnimationGroup *QAnimationController::getGroup(int index) const

Renvoie l'adresse AnimationGroup avec l'adresse index donnée.

Note : Cette fonction peut être invoquée via le système de méta-objets et à partir de QML. Voir Q_INVOKABLE.

void QAnimationController::removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)

Supprime le site animationGroup du contrôleur.

void QAnimationController::setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups)

Définit le site animationGroups pour le contrôleur. Les anciens groupes sont effacés.

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