Qt3DAnimation::QMorphingAnimation Class
class Qt3DAnimation::QMorphingAnimationEine Klasse, die Blend-Shape-Morphing-Animationen implementiert. Mehr...
| Überschrift: | #include <qmorphinganimation.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| In QML: | MorphingAnimation |
| Erbt von: | Qt3DAnimation::QAbstractAnimation |
| Status: | Technologie-Vorschau |
Diese Klasse befindet sich in der Technologievorschau und kann sich noch ändern.
Öffentliche Typen
| enum | Method { Normalized, Relative } |
Eigenschaften
|
|
Öffentliche Funktionen
| 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 |
Öffentliche Slots
| 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) |
Signale
| 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) |
Detaillierte Beschreibung
Eine „ Qt3DAnimation::QMorphingAnimation “-Klasse implementiert eine Blend-Shape-Morphing-Animation zu einem Ziel-„ QGeometryRenderer “. Die „QMorphingAnimation“ setzt die korrekten „ QAttributes “ vom „ morph targets “ auf das Ziel-„ QGeometryRenderer::geometry “ und berechnet den Interpolator für die aktuelle Position. Die eigentliche Überblendung zwischen den Attributen muss im Material implementiert werden. Qt3DAnimation::QMorphPhongMaterial implementiert ein Material mit Morphing-Unterstützung für das Phong-Beleuchtungsmodell. Die Überblendung erfolgt zwischen zwei Attributen – „base“ und „target“. Die Namen für die Basis- und Zielattribute werden aus den Namen der Morph-Ziele übernommen, wobei das Basisattribut seinen bisherigen Namen behält und dem Namen des Zielattributs „Target“ angehängt wird. Der Interpolator kann als „ QParameter “ für das verwendete Material festgelegt werden. Alle Morph-Ziele in der Animation sollten Attribute mit denselben Namen enthalten wie die Basisgeometrie.
Dokumentation zum Mitgliedstyp
enum QMorphingAnimation::Method
Diese Aufzählung legt die Morphing-Methode fest.
| Konstante | Wert | Beschreibung |
|---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | Für die Überblendung soll die normalisierte Formel verwendet werden: V' = Vbase * (1,0 - sum(Wi)) + sum[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | Die Überblendung soll nach der relativen Formel erfolgen: V' = Vbase + sum[Vi * Wi] |
Dokumentation zur Eigenschaft
easing : QEasingCurve
Enthält die Überblendkurve des Interpolators zwischen den Morph-Zielen.
Zugriffsfunktionen:
| QEasingCurve | easing() const |
| void | setEasing(const QEasingCurve &easing) |
Benachrichtigungssignal:
| void | easingChanged(const QEasingCurve &easing) |
[read-only] interpolator : float
Enthält den Interpolator zwischen Basis- und Zielattributen.
Zugriffsfunktionen:
| float | interpolator() const |
Benachrichtigungssignal:
| void | interpolatorChanged(float interpolator) |
method : Method
Enthält die Morphing-Methode. Die Standardeinstellung ist „Relativ“.
Zugriffsfunktionen:
| Qt3DAnimation::QMorphingAnimation::Method | method() const |
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
Benachrichtigungssignal:
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer*
Enthält den Ziel-QGeometryRenderer, auf den die Morphing-Animation angewendet wird.
Zugriffsfunktionen:
| Qt3DRender::QGeometryRenderer * | target() const |
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Notifier-Signal:
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
targetName : QString
Enthält den Namen der Zielgeometrie. Dies ist eine Komfort-Eigenschaft, die es einfacher macht, die Zielgeometrie an die Morphing-Animation anzupassen. Der Name entspricht in der Regel dem Namen der übergeordneten Entität des Ziel-QGeometryRenderers, muss dies jedoch nicht unbedingt tun.
Zugriffsfunktionen:
| QString | targetName() const |
| void | setTargetName(const QString name) |
Notifier-Signal:
| void | targetNameChanged(const QString &name) |
targetPositions : QVector<float>
Enthält die Positionswerte des Morph-Ziels. Jede Position in der Liste gibt die Position des entsprechenden Morph-Ziels mit demselben Index an. Die Werte müssen in aufsteigender Reihenfolge angeordnet sein. Die Werte können positiv oder negativ sein und haben keine vordefinierte Einheit.
Zugriffsfunktionen:
| QVector<float> | targetPositions() const |
| void | setTargetPositions(const QVector<float> &targetPositions) |
Notifier-Signal:
| void | targetPositionsChanged(const QVector<float> &targetPositions) |
Dokumentation der Mitgliedsfunktionen
[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Erstellen Sie eine neue „QMorphingAnimation“ mit „ parent “.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Füge am Ende der Animation den neuen Morph „ target “ hinzu.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Gib die Morph-Gewichte unter positionIndex zurück.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Gibt die Liste der Morph-Ziele zurück.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Entferne den Morph „ target “ aus der Animation.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Setzt die Morph- targets en auf „Animation“. Alte Ziele werden gelöscht.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Stellt den Morph- weights us unter positionIndex ein.
© 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.