Qt3DAnimation::QMorphingAnimation Class
class Qt3DAnimation::QMorphingAnimationUma classe que implementa animação de morphing com blend-shapes. Mais...
| Cabeçalho: | #include <qmorphinganimation.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| No QML: | MorphingAnimation |
| Herda de: | Qt3DAnimation::QAbstractAnimation |
| Status: | Pré-visualização tecnológica |
Esta classe está em pré-visualização tecnológica e está sujeita a alterações.
Tipos públicos
| enum | Method { Normalized, Relative } |
Propriedades
|
|
Funções públicas
| 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 |
Slots públicos
| 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) |
Sinais
| 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) |
Descrição detalhada
A classe ` Qt3DAnimation::QMorphingAnimation ` implementa animação de morphing com blend-shape para um ` QGeometryRenderer` de destino. A `QMorphingAnimation` define o ` QAttributes ` correto, partindo do ` morph targets ` até o ` QGeometryRenderer::geometry ` de destino, e calcula o interpolador para a posição atual. A mistura propriamente dita entre os atributos deve ser implementada no material. Qt3DAnimation::QMorphPhongMaterial implementa um material com suporte a morphing para o modelo de iluminação Phong. A mistura ocorre entre dois atributos: “base” e “alvo”. Os nomes dos atributos base e alvo são retirados dos nomes dos alvos de morph, em que o atributo base mantém o nome que já possui e o nome do atributo alvo tem “Target” acrescentado ao nome. O interpolador pode ser definido como um QParameter para o material utilizado. Todos os alvos de morph na animação devem conter os atributos com os mesmos nomes que aqueles na geometria base.
Documentação sobre tipos de membros
enum QMorphingAnimation::Method
Esta enumeração especifica o método de morphing.
| Constante | Valor | Descrição |
|---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | A mistura deve usar a fórmula normalizada; V' = Vbase * (1,0 - soma(Wi)) + soma[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | A mistura deve usar a fórmula relativa; V' = Vbase + soma[Vi * Wi] |
Documentação da propriedade
easing : QEasingCurve
Armazena a curva de suavização do interpolador entre os alvos de transformação.
Funções de acesso:
| QEasingCurve | easing() const |
| void | setEasing(const QEasingCurve &easing) |
Sinal do notificador:
| void | easingChanged(const QEasingCurve &easing) |
[read-only] interpolator : float
Contém o interpolador entre os atributos de base e de destino.
Funções de acesso:
| float | interpolator() const |
Sinal do notificador:
| void | interpolatorChanged(float interpolator) |
method : Method
Define o método de morphing. O padrão é “Relativo”.
Funções de acesso:
| Qt3DAnimation::QMorphingAnimation::Method | method() const |
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
Sinal do notificador:
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer*
Contém o objeto `QGeometryRenderer` de destino ao qual a animação de morphing é aplicada.
Funções de acesso:
| Qt3DRender::QGeometryRenderer * | target() const |
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Sinal do Notifier:
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
targetName : QString
Contém o nome da geometria de destino. Trata-se de uma propriedade de conveniência que facilita a correspondência entre a geometria de destino e a animação de morphing. O nome geralmente é o mesmo que o da entidade pai do QGeometryRenderer de destino, mas não precisa ser necessariamente assim.
Funções de acesso:
| QString | targetName() const |
| void | setTargetName(const QString name) |
Sinal de notificação:
| void | targetNameChanged(const QString &name) |
targetPositions : QVector<float>
Contém os valores de posição do alvo de transformação. Cada posição na lista especifica a posição do alvo de transformação correspondente com o mesmo índice. Os valores devem estar em ordem crescente. Os valores podem ser positivos ou negativos e não possuem nenhuma unidade predefinida.
Funções de acesso:
| QVector<float> | targetPositions() const |
| void | setTargetPositions(const QVector<float> &targetPositions) |
Sinal de notificação:
| void | targetPositionsChanged(const QVector<float> &targetPositions) |
Documentação das funções de membro
[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Crie uma nova instância de `QMorphingAnimation` com ` parent`.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Adicione um novo morph “ target ” no final da animação.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Retorne os pesos de transformação em positionIndex.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Retorna a lista de alvos de morfagem.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Remova a transição “ target ” da animação.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Defina a propriedade “ targets ” do morph como “animation”. Os alvos anteriores são apagados.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Conjuntos de morph weights em 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.