QMorphingAnimation Class
class Qt3DAnimation::QMorphingAnimationEine Klasse, die eine Blend-Shape-Morphing-Animation implementiert. Mehr...
Kopfzeile: | #include <QMorphingAnimation> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
qmake: | QT += 3danimation |
In QML: | MorphingAnimation |
Vererbt: | Qt3DAnimation::QAbstractAnimation |
Status: | Veraltet |
Ö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
Die Klasse Qt3DAnimation::QMorphingAnimation implementiert eine Blend-Shape-Morphing-Animation zu einem Ziel QGeometryRenderer. Die QMorphingAnimation setzt die korrekte QAttributes vom morph targets zum 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 Material mit Morphing-Unterstützung für das Phong-Lichtmodell. Die Überblendung erfolgt zwischen 2 Attributen - 'base' und 'target'. Die Namen für die Basis- und Ziel-Attribute werden von den Morph-Ziel-Namen übernommen, wobei das Basis-Attribut den Namen behält, den es bereits hat, und der Name des Ziel-Attributs mit dem Zusatz "Ziel" versehen wird. Der Interpolator kann als QParameter auf das verwendete Material gesetzt werden. Alle Morph-Ziele in der Animation sollten die Attribute mit den gleichen Namen wie die der Basisgeometrie enthalten.
Dokumentation der Mitgliedertypen
enum QMorphingAnimation::Method
Diese Aufzählung gibt die Morphing-Methode an.
Konstante | Wert | Beschreibung |
---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | Die Überblendung sollte die normalisierte Formel V' = Vbase * (1.0 - sum(Wi)) + Summe[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | Für das Blending sollte die relative Formel verwendet werden: V' = Vbase + Summe[Vi * Wi] |
Dokumentation der Eigenschaften
easing : QEasingCurve
Enthält die Lockerungskurve des Interpolators zwischen den Morph-Zielen.
Zugriffsfunktionen:
QEasingCurve | easing() const |
void | setEasing(const QEasingCurve &easing) |
Melder-Signal:
void | easingChanged(const QEasingCurve &easing) |
[read-only]
interpolator : const float
Enthält den Interpolator zwischen Basis- und Zielattributen.
Zugriffsfunktionen:
float | interpolator() const |
Anmelder-Signal:
void | interpolatorChanged(float interpolator) |
method : Method
Enthält die Morphing-Methode. Die Voreinstellung ist Relativ.
Zugriffsfunktionen:
Qt3DAnimation::QMorphingAnimation::Method | method() const |
void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
Melder-Signal:
void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer*
Enthält den QGeometryRenderer, auf den die Morphing-Animation angewendet wird.
Zugriffsfunktionen:
Qt3DRender::QGeometryRenderer * | target() const |
void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Benachrichtigungssignal:
void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
targetName : QString
Enthält den Namen der Zielgeometrie. Dies ist eine praktische Eigenschaft, die es einfacher macht, die Zielgeometrie der Morphing-Animation zuzuordnen. Der Name ist normalerweise derselbe wie der Name der übergeordneten Entität des Ziel QGeometryRenderer, muss es aber nicht sein.
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 stehen. 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) |
Member Function Dokumentation
[explicit]
QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Konstruieren Sie eine neue QMorphingAnimation mit parent.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Fügen Sie am Ende der Animation einen neuen Morph target hinzu.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Rückgabe der Morph-Gewichte unter positionIndex.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Rückgabe der Morph-Zielliste.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Entfernen Sie den Morph target aus der Animation.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Morph targets auf Animation setzen. Alte Ziele werden gelöscht.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Setzt den Morph weights auf positionIndex.
© 2025 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.