Qt3DAnimation::QAnimationController Class
class Qt3DAnimation::QAnimationControllerUne classe de contrôleur pour les animations. En savoir plus...
| En-tête : | #include <qanimationcontroller.h> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake : | QT += 3danimation |
| En QML : | AnimationController |
| Hérite de : | QObject |
| Statut : | Aperçu technologique |
Cette classe est en avant-première technologique et est susceptible d'être modifiée.
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 gère la sélection et la lecture des animations. Elle permet de rechercher toutes les animations dans l’arborescence Qt3DCore::QEntity et de créer des objets ` QAnimationGroups ` à partir des animations portant le même nom. L’utilisateur peut choisir le groupe d’animations actuellement contrôlé par le contrôleur d’animation en définissant l’animation active. La position de l’animation est ensuite propagée à ce groupe après mise à l’échelle et décalage de la valeur de position fournie à l’aide des paramètres ` positionScale ` et ` positionOffset `.
Remarque : le contrôleur d’animation ne dispose pas de minuterie interne ;c’est donc à l’utilisateur qu’il incombe de mettre à jour la propriété de position en temps voulu.
Documentation des 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 collecté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
Contient la position actuelle de l'animation. Une fois la position définie, elle est mise à l'échelle et décalée à l'aide de ` positionScale` / `positionOffset `, puis répercutée sur le groupe d'animations actif.
Fonctions d'accès :
| float | position() const |
| void | setPosition(float position) |
Signal de notification :
| void | positionChanged(float position) |
positionOffset : float
Contient 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éfinit 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 s'il faut effectuer une recherche récursive dans l'arborescence des entités lors de la collecte des animations à partir de l'entité. Si la valeur est « true », les animations sont également recherchées parmi les entités enfants de l'entité. Si la valeur est « false », seule l'entité transmise au contrôleur est parcourue.
Fonctions d'accès :
| bool | recursive() const |
| void | setRecursive(bool recursive) |
Signal de notification :
| void | recursiveChanged(bool recursive) |
Documentation des fonctions membres
QAnimationController::QAnimationController(QObject *parent = nullptr)
Crée un nouvel objet `QAnimationController` avec ` parent`.
void QAnimationController::addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Ajoute l'animationGroup on indiquée au contrôleur.
QList<Qt3DAnimation::QAnimationGroup *> QAnimationController::animationGroupList()
Renvoie la liste des groupes d'animation que le contrôleur contient actuellement.
[invokable] int QAnimationController::getAnimationIndex(const QString &name) const
Renvoie l'index de l'animation avec l'name. Renvoie -1 si aucune animation portant le nom indiqué n'est trouvée. AnimationGroup.
Remarque : cette fonction peut être appelée via le système de méta-objets et depuis QML. Voir Q_INVOKABLE.
[invokable] Qt3DAnimation::QAnimationGroup *QAnimationController::getGroup(int index) const
Renvoie l'AnimationGroup avec l'index donné.
Remarque : cette fonction peut être appelée via le système de méta-objets et depuis QML. Voir Q_INVOKABLE.
void QAnimationController::removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Supprime l'animationGroup spécifiée du contrôleur.
void QAnimationController::setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups)
Définit les groupes « animationGroups » pour le contrôleur. Les anciens groupes sont supprimé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.