En esta página

Qt3DAnimation::QMorphingAnimation Class

class Qt3DAnimation::QMorphingAnimation

Una clase que implementa la animación blend-shape morphing. Más...

Cabecera: #include <QMorphingAnimation>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
En QML: MorphingAnimation
Hereda: Qt3DAnimation::QAbstractAnimation
Status: Obsoleto

Tipos públicos

enum Method { Normalized, Relative }

Propiedades

Funciones 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

Ranuras públicas

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)

Señales

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)

Descripción detallada

Una clase Qt3DAnimation::QMorphingAnimation implementa animación de morphing de forma de mezcla a un objetivo QGeometryRenderer. El QMorphingAnimation establece el correcto QAttributes desde el morph targets al objetivo QGeometryRenderer::geometry y calcula el interpolador para la posición actual. La mezcla real entre los atributos debe ser implementada en el material. Qt3DAnimation::QMorphPhongMaterial implementa un material con soporte de morphing para el modelo de iluminación phong. La mezcla se realiza entre 2 atributos - 'base' y 'target'. Los nombres de los atributos base y destino se toman de los nombres de destino morph, donde el atributo base mantiene el nombre que ya tiene y el nombre del atributo destino tiene 'Target' añadido al nombre. El interpolador puede establecerse como QParameter para el material utilizado. Todos los objetivos morph de la animación deben contener los atributos con los mismos nombres que los de la geometría base.

Documentación de tipos de miembros

enum QMorphingAnimation::Method

Esta enumeración especifica el método de morphing.

ConstanteValorDescripción
Qt3DAnimation::QMorphingAnimation::Normalized0La mezcla debe utilizar la fórmula normalizada; V' = Vbase * (1.0 - sum(Wi)) + suma[Vi * Wi]
Qt3DAnimation::QMorphingAnimation::Relative1La mezcla debe utilizar la fórmula relativa; V' = Vbase + suma[Vi * Wi].

Documentación de propiedades

easing : QEasingCurve

Mantiene la curva de flexión del interpolador entre objetivos morph.

Funciones de acceso:

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

Señal del notificador:

void easingChanged(const QEasingCurve &easing)

[read-only] interpolator : float

Contiene el interpolador entre los atributos base y destino.

Funciones de acceso:

float interpolator() const

Señal notificadora:

void interpolatorChanged(float interpolator)

method : Method

Indica el método de morphing. Por defecto es Relativo.

Funciones de acceso:

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

Señal del notificador:

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

target : Qt3DRender::QGeometryRenderer*

Contiene el QGeometryRenderer de destino al que se aplica la animación morphing.

Funciones de acceso:

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

Señal notificadora:

void targetChanged(Qt3DRender::QGeometryRenderer *target)

targetName : QString

Contiene el nombre de la geometría objetivo. Esta es una propiedad de conveniencia que hace más fácil hacer coincidir la geometría objetivo con la animación morphing. El nombre suele ser el mismo que el de la entidad padre del QGeometryRenderer objetivo, pero no tiene por qué serlo.

Funciones de acceso:

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

Señal notificadora:

void targetNameChanged(const QString &name)

targetPositions : QVector<float>

Contiene los valores de posición del objetivo morph. Cada posición de la lista especifica la posición del objetivo morph correspondiente con el mismo índice. Los valores deben estar en orden ascendente. Los valores pueden ser positivos o negativos y no tienen ninguna unidad predefinida.

Funciones de acceso:

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

Señal del notificador:

void targetPositionsChanged(const QVector<float> &targetPositions)

Documentación de la función miembro

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

Construye una nueva QMorphingAnimation con parent.

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

Añadir nuevo morph target al final de la animación.

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

Devuelve los pesos morph en positionIndex.

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

Devuelve la lista de objetivos morph.

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

Elimina el morph target de la animación.

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

Establecer morph targets a la animación. Los objetivos antiguos se borran.

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

Establece el morph weights en 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.