QVertexBlendAnimation Class

class Qt3DAnimation::QVertexBlendAnimation

A class implementing vertex-blend morphing animation. More...

Header: #include <QVertexBlendAnimation>
qmake: QT += 3danimation
Since: Qt 5.9
Instantiated By: VertexBlendAnimation
Inherits: Qt3DAnimation::QAbstractAnimation

This class was introduced in Qt 5.9.

Public Functions

QVertexBlendAnimation(QObject *parent = nullptr)
void addMorphTarget(Qt3DAnimation::QMorphTarget *target)
QVector<Qt3DAnimation::QMorphTarget *> morphTargetList()
void removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
void setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)

Detailed Description

A Qt3DAnimation::QVertexBlendAnimation class implements vertex-blend morphing animation to a target QGeometryRenderer. The QVertexBlendAnimation sets the correct QAttributes from the morph targets to the target QGeometryRenderer::geometry and calculates interpolator for the current position. Unlike with QMorphingAnimation, where the blending is controller with blend weights, the blending occurs between sequential morph targets. The actual blending between the attributes must be implemented in the material. Qt3DAnimation::QMorphPhongMaterial implements material with morphing support for phong lighting model. The blending happens between 2 attributes - 'base' and 'target'. The names for the base and target attributes are taken from the morph target names, where the base attribute retains the name it already has and the target attribute name gets 'Target' appended to the name. The interpolator can be set as a QParameter to the used material. All morph targets in the animation should contain the attributes with same names as those in the base geometry.

Member Function Documentation

QVertexBlendAnimation::QVertexBlendAnimation(QObject *parent = nullptr)

Construct a new QVertexBlendAnimation with parent.

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

Add new morph target at the end of the animation.

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

Return morph target list.

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

Remove morph target from the animation.

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

Set morph targets to animation. Old targets are cleared.