QVertexBlendAnimation Class

( Qt3DAnimation::QVertexBlendAnimation )

A class implementing vertex-blend morphing animation. 更多...

頭: #include <QVertexBlendAnimation>
qmake: QT += 3danimation
Since: Qt 5.9
實例化: VertexBlendAnimation
繼承: Qt3DAnimation::QAbstractAnimation

特性

公共函數

QVertexBlendAnimation (QObject * parent = nullptr)
void addMorphTarget (Qt3DAnimation::QMorphTarget * target )
float interpolator () const
QVector<Qt3DAnimation::QMorphTarget *> morphTargetList ()
void removeMorphTarget (Qt3DAnimation::QMorphTarget * target )
void setMorphTargets (const QVector<Qt3DAnimation::QMorphTarget *> & 目標 )
Qt3DRender::QGeometryRenderer * target () const
QString targetName () const
QVector<float> targetPositions () const

公共槽

void setTarget (Qt3DRender::QGeometryRenderer * target )
void setTargetName (const QString name )
void setTargetPositions (const QVector<float> & targetPositions )

信號

void interpolatorChanged (float interpolator )
void targetChanged (Qt3DRender::QGeometryRenderer * target )
void targetNameChanged (const QString & name )
void targetPositionsChanged (const QVector<float> & targetPositions )

靜態公共成員

const QMetaObject staticMetaObject

額外繼承成員

詳細描述

A class implementing vertex-blend morphing animation.

A Qt3DAnimation::QVertexBlendAnimation class implements vertex-blend morphing animation to a target QGeometryRenderer QVertexBlendAnimation sets the correct QAttributes 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.

特性文檔編製

interpolator : const float

Holds the interpolator between base and target attributes.

訪問函數:

float interpolator () const

通知程序信號:

void interpolatorChanged (float interpolator )

target : Qt3DRender::QGeometryRenderer *

Holds the target QGeometryRenderer the morphing animation is applied to.

訪問函數:

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

通知程序信號:

void targetChanged (Qt3DRender::QGeometryRenderer * target )

targetName : QString

Holds the name of the target geometry. This is a convenience property making it easier to match the target geometry to the morphing animation. The name is usually same as the name of the parent entity of the target QGeometryRenderer, but does not have to be.

訪問函數:

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

通知程序信號:

void targetNameChanged (const QString & name )

targetPositions : QVector < float >

Holds the position values of the morph target. Each position in the list specifies the position of the corresponding morph target with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.

訪問函數:

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

通知程序信號:

void targetPositionsChanged (const QVector<float> & targetPositions )

成員函數文檔編製

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 *> & 目標 )

Set morph 目標 to animation. Old targets are cleared.