Qt3DAnimation::QVertexBlendAnimation Class
class Qt3DAnimation::QVertexBlendAnimationUne classe implémentant une animation de morphing par fusion de sommets. En savoir plus...
| En-tête : | #include <qvertexblendanimation.h> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake : | QT += 3danimation |
| En QML : | VertexBlendAnimation |
| Hérite de : | Qt3DAnimation::QAbstractAnimation |
| Statut : | Aperçu technologique |
Cette classe est en avant-première technologique et est susceptible d'être modifiée.
Propriétés
- interpolator : float
- target : Qt3DRender::QGeometryRenderer*
- targetName : QString
- targetPositions : QList<float>
Fonctions publiques
| QVertexBlendAnimation(QObject *parent = nullptr) | |
| void | addMorphTarget(Qt3DAnimation::QMorphTarget *target) |
| float | interpolator() const |
| QList<Qt3DAnimation::QMorphTarget *> | morphTargetList() |
| void | removeMorphTarget(Qt3DAnimation::QMorphTarget *target) |
| void | setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets) |
| Qt3DRender::QGeometryRenderer * | target() const |
| QString | targetName() const |
| QList<float> | targetPositions() const |
Emplacements publics
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
| void | setTargetName(const QString name) |
| void | setTargetPositions(const QList<float> &targetPositions) |
Signaux
| void | interpolatorChanged(float interpolator) |
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
| void | targetNameChanged(const QString &name) |
| void | targetPositionsChanged(const QList<float> &targetPositions) |
Description détaillée
Une classe « Qt3DAnimation::QVertexBlendAnimation » implémente une animation de morphing par mélange de sommets vers une cible « QGeometryRenderer ». La classe « QVertexBlendAnimation » définit l’ QAttributes e correcte entre l’« morph targets » et la cible « QGeometryRenderer::geometry », puis calcule l’interpolateur pour la position actuelle. Contrairement à « QMorphingAnimation », où le mélange est contrôlé par des poids de mélange, le mélange s’effectue entre des cibles de morphing séquentielles. Le mélange proprement dit 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 « target » sont tirés des noms des cibles de morphing : l’attribut « base » conserve son nom d’origine, tandis que le nom de l’attribut « target » est suivi de la suffixe « Target ». L’interpolateur peut être défini en tant qu’ QParameter e du matériau utilisé. Toutes les cibles de morphing de l’animation doivent contenir des attributs portant les mêmes noms que ceux de la géométrie de base.
Documentation sur les propriétés
[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) |
target : Qt3DRender::QGeometryRenderer*
Contient l'objet `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é pratique qui facilite l'association de la géométrie cible à l'animation de morphing. Ce nom correspond généralement à celui 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 : QList<float>
Contient les valeurs de position de la cible de morphing. Chaque position de la liste spécifie la position de la cible de morphing correspondante portant le même index. Les valeurs doivent être classées par ordre croissant. Elles peuvent être positives ou négatives et n'ont pas d'unité prédéfinie.
Fonctions d'accès :
| QList<float> | targetPositions() const |
| void | setTargetPositions(const QList<float> &targetPositions) |
Signal de notification :
| void | targetPositionsChanged(const QList<float> &targetPositions) |
Documentation des fonctions membres
[explicit] QVertexBlendAnimation::QVertexBlendAnimation(QObject *parent = nullptr)
Créez un nouvel objet `QVertexBlendAnimation` à l'aide de ` parent`.
void QVertexBlendAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Ajouter un nouveau morphing « target » à la fin de l'animation.
QList<Qt3DAnimation::QMorphTarget *> QVertexBlendAnimation::morphTargetList()
Renvoie la liste des cibles de morphing.
void QVertexBlendAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Supprimer la morp target e de l'animation.
void QVertexBlendAnimation::setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets)
Définit l'targets de la transformation sur « animation ». Les anciennes cibles sont effacées.
© 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.