Qt3DAnimation::QMorphingAnimation Class
class Qt3DAnimation::QMorphingAnimationUne classe mettant en œuvre l'animation de morphing de formes mélangées. Plus d'informations...
| En-tête : | #include <QMorphingAnimation> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS 3danimation)target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake : | QT += 3danimation |
| En QML : | MorphingAnimation |
| Hérite : | Qt3DAnimation::QAbstractAnimation |
| Statut : | Déclassé |
Types publics
| enum | Method { Normalized, Relative } |
Propriétés
|
|
Fonctions publiques
| QMorphingAnimation(QObject *parent = nullptr) | |
| void | addMorphTarget(Qt3DAnimation::QMorphTarget *target) |
| QEasingCurve | easing() const |
| QVector<float> | getWeights(int positionIndex) |
| float | interpolator() const |
| Qt3DAnimation::QMorphingAnimation::Method | method() const |
| QVector<Qt3DAnimation::QMorphTarget *> | morphTargetList() |
| void | removeMorphTarget(Qt3DAnimation::QMorphTarget *target) |
| void | setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets) |
| void | setWeights(int positionIndex, const QVector<float> &weights) |
| Qt3DRender::QGeometryRenderer * | target() const |
| QString | targetName() const |
| QVector<float> | targetPositions() const |
Emplacements publics
| void | setEasing(const QEasingCurve &easing) |
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
| void | setTargetName(const QString name) |
| void | setTargetPositions(const QVector<float> &targetPositions) |
Signaux
| void | easingChanged(const QEasingCurve &easing) |
| void | interpolatorChanged(float interpolator) |
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
| void | targetNameChanged(const QString &name) |
| void | targetPositionsChanged(const QVector<float> &targetPositions) |
Description détaillée
Une classe Qt3DAnimation::QMorphingAnimation implémente l'animation de morphing de formes mixtes vers une cible QGeometryRenderer. La QMorphingAnimation définit la bonne QAttributes entre morph targets et la cible QGeometryRenderer::geometry et calcule l'interpolateur pour la position actuelle. Le mélange réel entre les attributs doit être implémenté dans le matériau. Qt3DAnimation::QMorphPhongMaterial implémente un matériau prenant en charge le morphing pour le modèle d'éclairage phong. Le mélange s'effectue entre deux attributs : "base" et "target". Les noms des attributs base et cible sont tirés des noms des cibles de morphing, l'attribut base conservant le nom qu'il porte déjà et le nom de l'attribut cible étant complété par "Target". L'interpolateur peut être défini comme QParameter pour le matériau utilisé. Toutes les cibles morphologiques de l'animation doivent contenir les attributs portant les mêmes noms que ceux de la géométrie de base.
Documentation des types de membres
enum QMorphingAnimation::Method
Cette énumération spécifie la méthode de morphing.
| Constante | Valeur | Description de la méthode |
|---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | Le mélange doit utiliser la formule normalisée ; V' = Vbase * (1.0 - sum(Wi)) + somme[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | Le mélange doit utiliser la formule relative ; V' = Vbase + somme[Vi * Wi] |
Documentation sur les propriétés
easing : QEasingCurve
Contient la courbe d'assouplissement de l'interpolateur entre les cibles morphologiques.
Fonctions d'accès :
| QEasingCurve | easing() const |
| void | setEasing(const QEasingCurve &easing) |
Signal de notification :
| void | easingChanged(const QEasingCurve &easing) |
[read-only] interpolator : float
Contient l'interpolateur entre les attributs de base et les attributs cibles.
Fonctions d'accès :
| float | interpolator() const |
Signal de notification :
| void | interpolatorChanged(float interpolator) |
method : Method
Indique la méthode de morphing. La valeur par défaut est Relative.
Fonctions d'accès :
| Qt3DAnimation::QMorphingAnimation::Method | method() const |
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
Signal de notification :
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer*
Détient le QGeometryRenderer cible auquel l'animation de morphing est appliquée.
Fonctions d'accès :
| Qt3DRender::QGeometryRenderer * | target() const |
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Signal de notification :
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
targetName : QString
Contient le nom de la géométrie cible. Il s'agit d'une propriété de commodité qui facilite la correspondance entre la géométrie cible et l'animation de morphing. Le nom est généralement identique au nom de l'entité parente du QGeometryRenderer cible, mais ce n'est pas obligatoire.
Fonctions d'accès :
| QString | targetName() const |
| void | setTargetName(const QString name) |
Signal de notification :
| void | targetNameChanged(const QString &name) |
targetPositions : QVector<float>
Contient les valeurs de position de la cible morphologique. Chaque position de la liste spécifie la position de la cible morphologique correspondante ayant le même index. Les valeurs doivent être classées par ordre croissant. Les valeurs peuvent être positives ou négatives et n'ont pas d'unité prédéfinie.
Fonctions d'accès :
| QVector<float> | targetPositions() const |
| void | setTargetPositions(const QVector<float> &targetPositions) |
Signal Notificateur :
| void | targetPositionsChanged(const QVector<float> &targetPositions) |
Member Function Documentation
[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Construire une nouvelle QMorphingAnimation avec parent.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Ajouter un nouveau morph target à la fin de l'animation.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Retourner les poids morphologiques à positionIndex.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Renvoi de la liste des cibles morphologiques.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Supprimez le morph target de l'animation.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Régler le morph targets sur l'animation. Les anciennes cibles sont effacées.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Fixe la morphologie weights à positionIndex.
© 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.