Sur cette page

Qt3DAnimation::QMorphingAnimation Class

class Qt3DAnimation::QMorphingAnimation

Une classe implémentant l'animation par morphing à l'aide de blend-shapes. En savoir plus...

En-tête : #include <qmorphinganimation.h>
CMake : find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake : QT += 3danimation
En QML : MorphingAnimation
Hérite de : Qt3DAnimation::QAbstractAnimation
Statut : Aperçu technologique

Cette classe est en avant-première technologique et est susceptible d'être modifiée.

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 une animation de morphing par blend-shapes vers une cible ` QGeometryRenderer`. La classe `QMorphingAnimation` définit l'QAttributes appropriée entre l'morph targets et la cible ` QGeometryRenderer::geometry `, puis calcule l'interpolateur pour la position actuelle. 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 de base et de cible sont tirés des noms des cibles de morphing : l’attribut de base conserve son nom d’origine, tandis que le nom de l’attribut de cible est suivi de la mention « 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 types de membres

enum QMorphingAnimation::Method

Cette énumération définit la méthode de morphing.

ConstanteValeurDescription
Qt3DAnimation::QMorphingAnimation::Normalized0Le mélange doit utiliser la formule normalisée : V' = Vbase * (1,0 - somme(Wi)) + somme[Vi * Wi]
Qt3DAnimation::QMorphingAnimation::Relative1Le mélange doit utiliser la formule relative : V' = Vbase + somme[Vi * Wi]

Documentation sur les propriétés

easing : QEasingCurve

Contient la courbe d'atténuation de l'interpolateur entre les cibles de morphing.

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

Définit 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*

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 : QVector<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 :

QVector<float> targetPositions() const
void setTargetPositions(const QVector<float> &targetPositions)

Signal de notification :

void targetPositionsChanged(const QVector<float> &targetPositions)

Documentation des fonctions membres

[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)

Créez une nouvelle instance de `QMorphingAnimation` à l'aide de ` parent`.

void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)

Ajouter un nouveau morph « target » à la fin de l'animation.

QVector<float> QMorphingAnimation::getWeights(int positionIndex)

Renvoie les poids de morphing à l'adresse positionIndex.

QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()

Renvoie la liste des cibles de morphing.

void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)

Supprimer la transition « morph » target de l’animation.

void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)

Définit l'targets e de morph en animation. Les anciennes cibles sont effacées.

void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)

Définit l'weights « morph » à l'adresse 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.