In questa pagina

Qt3DAnimation::QMorphingAnimation Class

class Qt3DAnimation::QMorphingAnimation

Una classe che implementa l'animazione di morphing basata su blend-shape. Per saperne di più...

Intestazione: #include <qmorphinganimation.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
In QML: MorphingAnimation
Eredita da: Qt3DAnimation::QAbstractAnimation
Stato: Anteprima tecnologica

Questa classe è in anteprima tecnologica ed è soggetta a modifiche.

Tipi pubblici

enum Method { Normalized, Relative }

Proprietà

Funzioni pubbliche

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

Slot pubblici

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)

Segnali

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)

Descrizione dettagliata

Una classe Qt3DAnimation::QMorphingAnimation implementa l'animazione di morphing con blend-shape su un QGeometryRenderer di destinazione. La classe QMorphingAnimation imposta l'QAttributes corretto dall'morph targets al QGeometryRenderer::geometry di destinazione e calcola l'interpolatore per la posizione corrente. La fusione effettiva tra gli attributi deve essere implementata nel materiale. Qt3DAnimation::QMorphPhongMaterial implementa un materiale con supporto al morphing per il modello di illuminazione Phong. La fusione avviene tra 2 attributi: «base» e «target». I nomi degli attributi base e target sono ricavati dai nomi dei morph target: l’attributo base mantiene il nome che già possiede, mentre al nome dell’attributo target viene aggiunto il suffisso «Target». L’interpolatore può essere impostato come « QParameter » (interpolatore di attributi) per il materiale utilizzato. Tutti i morph target nell’animazione devono contenere attributi con gli stessi nomi di quelli presenti nella geometria di base.

Documentazione sui tipi di membro

enum QMorphingAnimation::Method

Questa enumerazione specifica il metodo di morphing.

CostanteValoreDescrizione
Qt3DAnimation::QMorphingAnimation::Normalized0La fusione deve utilizzare la formula normalizzata; V' = Vbase * (1,0 - somma(Wi)) + somma[Vi * Wi]
Qt3DAnimation::QMorphingAnimation::Relative1La fusione deve utilizzare la formula relativa; V' = Vbase + somma[Vi * Wi]

Documentazione delle proprietà

easing : QEasingCurve

Contiene la curva di transizione dell'interpolatore tra i target di morphing.

Funzioni di accesso:

QEasingCurve easing() const
void setEasing(const QEasingCurve &easing)

Segnale di notifica:

void easingChanged(const QEasingCurve &easing)

[read-only] interpolator : float

Contiene l'interpolatore tra gli attributi di base e quelli di destinazione.

Funzioni di accesso:

float interpolator() const

Segnale di notifica:

void interpolatorChanged(float interpolator)

method : Method

Contiene il metodo di morphing. Il valore predefinito è "Relativo".

Funzioni di accesso:

Qt3DAnimation::QMorphingAnimation::Method method() const
void setMethod(Qt3DAnimation::QMorphingAnimation::Method method)

Segnale di notifica:

void methodChanged(Qt3DAnimation::QMorphingAnimation::Method method)

target : Qt3DRender::QGeometryRenderer*

Contiene l'oggetto QGeometryRenderer di destinazione a cui viene applicata l'animazione di morphing.

Funzioni di accesso:

Qt3DRender::QGeometryRenderer *target() const
void setTarget(Qt3DRender::QGeometryRenderer *target)

Segnale di notifica:

void targetChanged(Qt3DRender::QGeometryRenderer *target)

targetName : QString

Contiene il nome della geometria di destinazione. Si tratta di una proprietà di comodità che semplifica l'abbinamento della geometria di destinazione all'animazione di morphing. Il nome è solitamente lo stesso dell'entità padre del QGeometryRenderer di destinazione, ma non è obbligatorio che lo sia.

Funzioni di accesso:

QString targetName() const
void setTargetName(const QString name)

Segnale Notifier:

void targetNameChanged(const QString &name)

targetPositions : QVector<float>

Contiene i valori di posizione del morph target. Ogni voce dell'elenco specifica la posizione del morph target corrispondente con lo stesso indice. I valori devono essere in ordine crescente. I valori possono essere positivi o negativi e non hanno alcuna unità predefinita.

Funzioni di accesso:

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

Segnale di notifica:

void targetPositionsChanged(const QVector<float> &targetPositions)

Documentazione delle funzioni membro

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

Crea una nuova QMorphingAnimation con ` parent`.

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

Aggiungi il nuovo morph “ target ” alla fine dell’animazione.

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

Restituisce i pesi morfologici all’indirizzo positionIndex.

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

Restituisce l'elenco dei target di morphing.

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

Rimuovi il morph “ target ” dall’animazione.

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

Imposta "morph targets " su "animation". I vecchi target vengono cancellati.

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

Imposta il morph weights all'indirizzo 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.