Qt3DAnimation::QMorphingAnimation Class
class Qt3DAnimation::QMorphingAnimationUna clase que implementa la animación de transformación mediante formas de mezcla. Más información...
| Encabezado: | #include <qmorphinganimation.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| En QML: | MorphingAnimation |
| Heredado de: | Qt3DAnimation::QAbstractAnimation |
| Estado: | Versión preliminar |
Esta clase se encuentra en fase de vista previa tecnológica y está sujeta a cambios.
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 una animación de morphing de blend-shape hacia un destino ` QGeometryRenderer`. La clase `QMorphingAnimation` establece el ` QAttributes ` correcto desde el ` morph targets ` hasta el destino ` QGeometryRenderer::geometry ` y calcula el interpolador para la posición actual. La mezcla real entre los atributos debe implementarse en el material. Qt3DAnimation::QMorphPhongMaterial implementa un material con soporte de morphing para el modelo de iluminación Phong. La mezcla se produce entre dos atributos: «base» y «target». Los nombres de los atributos base y de destino se toman de los nombres de los objetivos de morphing, donde el atributo base conserva el nombre que ya tiene y al nombre del atributo de destino se le añade «Target». El interpolador se puede establecer como un « QParameter » del material utilizado. Todos los objetivos de morphing de la animación deben contener los atributos con los mismos nombres que los de la geometría base.
Documentación sobre los tipos de miembros
enum QMorphingAnimation::Method
Esta enumeración especifica el método de transformación.
| Constante | Valor | Descripción |
|---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | La mezcla debe utilizar la fórmula normalizada: V' = Vbase * (1,0 - sum(Wi)) + sum[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | La mezcla debe utilizar la fórmula relativa; V' = Vbase + suma[Vi * Wi] |
Documentación de la propiedad
easing : QEasingCurve
Almacena la curva de suavizado del interpolador entre los objetivos de transformación.
Funciones de acceso:
| QEasingCurve | easing() const |
| void | setEasing(const QEasingCurve &easing) |
Señal de notificación:
| void | easingChanged(const QEasingCurve &easing) |
[read-only] interpolator : float
Almacena el interpolador entre los atributos de base y de destino.
Funciones de acceso:
| float | interpolator() const |
Señal de notificación:
| void | interpolatorChanged(float interpolator) |
method : Method
Almacena el método de transformación. El valor por defecto es «Relativo».
Funciones de acceso:
| Qt3DAnimation::QMorphingAnimation::Method | method() const |
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) |
Señal de notificación:
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer*
Contiene el objeto `QGeometryRenderer` de destino al que se aplica la animación de transformación.
Funciones de acceso:
| Qt3DRender::QGeometryRenderer * | target() const |
| void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Señal de notificador:
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
targetName : QString
Contiene el nombre de la geometría de destino. Se trata de una propiedad de conveniencia que facilita la correspondencia entre la geometría de destino y la animación de transformación. El nombre suele ser el mismo que el de la entidad padre del QGeometryRenderer de destino, aunque no tiene por qué serlo.
Funciones de acceso:
| QString | targetName() const |
| void | setTargetName(const QString name) |
Señal de notificación:
| void | targetNameChanged(const QString &name) |
targetPositions : QVector<float>
Contiene los valores de posición del objetivo de transformación. Cada posición de la lista especifica la posición del objetivo de transformación correspondiente con el mismo índice. Los valores deben estar ordenados de menor a mayor. 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 de notificador:
| void | targetPositionsChanged(const QVector<float> &targetPositions) |
Documentación de las funciones de miembro
[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Crea una nueva QMorphingAnimation con ` parent`.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Añade un nuevo morfo « target » al final de la animación.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Devuelve los pesos de transformación en positionIndex.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Devuelve la lista de objetivos de transformación.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Elimina el «morph» « target » de la animación.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Establece el « targets » de la transformación en «animación». Se borran los objetivos anteriores.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Sets 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.