QMorphingAnimation Class
(Qt3DAnimation::QMorphingAnimation)A class implementing blend-shape morphing animation 更多...
头文件: | #include <QMorphingAnimation> |
qmake: | QT += 3danimation |
开始支持版本: | Qt 5.9 |
Instantiated By: | MorphingAnimation |
基类: | QAbstractAnimation |
公有类型
enum | Method { Normalized, Relative } |
属性
|
|
- 6 个属性继承自 QAbstractAnimation
- 1 个属性继承自 QObject
公有函数
QMorphingAnimation(QObject *parent = nullptr) | |
void | addMorphTarget(Qt3DAnimation::QMorphTarget *target) |
QEasingCurve | easing() const |
QVector<float> | getWeights(int positionIndex) |
float | interpolator() const |
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 |
- 11 个公有函数继承自 QAbstractAnimation
- 32 个公有函数继承自 QObject
公有槽函数
void | setEasing(const QEasingCurve &easing) |
void | setMethod(QMorphingAnimation::Method method) |
void | setTarget(Qt3DRender::QGeometryRenderer *target) |
void | setTargetName(const QString name) |
void | setTargetPositions(const QVector<float> &targetPositions) |
- 6 个公有槽函数继承自 QAbstractAnimation
- 1 个公有槽函数继承自 QObject
信号
void | easingChanged(const QEasingCurve &easing) |
void | interpolatorChanged(float interpolator) |
void | methodChanged(QMorphingAnimation::Method method) |
void | targetChanged(Qt3DRender::QGeometryRenderer *target) |
void | targetNameChanged(const QString &name) |
void | targetPositionsChanged(const QVector<float> &targetPositions) |
- 4 个信号继承自 QAbstractAnimation
- 2 个信号继承自 QObject
其他继承的成员
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 4 个受保护的函数继承自 QAbstractAnimation
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
A class implementing blend-shape morphing animation
A Qt3DAnimation::QMorphingAnimation class implements blend-shape morphing animation to a target QGeometryRenderer. The QMorphingAnimation sets the correct QAttributes from the morph targets to the target QGeometryRenderer::geometry and calculates interpolator for the current position. 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.
成员类型
enum QMorphingAnimation::Method
This enumeration specifies the morphing method.
Constant | Value | Description |
---|---|---|
Qt3DAnimation::QMorphingAnimation::Normalized | 0 | The blending should use the normalized formula; V' = Vbase * (1.0 - sum(Wi)) + sum[Vi * Wi] |
Qt3DAnimation::QMorphingAnimation::Relative | 1 | The blending should use the relative formula; V' = Vbase + sum[Vi * Wi] |
属性
easing : QEasingCurve
Holds the easing curve of the interpolator between morph targets.
访问函数:
QEasingCurve | easing() const |
void | setEasing(const QEasingCurve &easing) |
Notifier signal:
void | easingChanged(const QEasingCurve &easing) |
interpolator : const float
Holds the interpolator between base and target attributes.
访问函数:
float | interpolator() const |
Notifier signal:
void | interpolatorChanged(float interpolator) |
method : QMorphingAnimation::Method
Holds the morphing method. The default is Relative.
访问函数:
QMorphingAnimation::Method | method() const |
void | setMethod(QMorphingAnimation::Method method) |
Notifier signal:
void | methodChanged(QMorphingAnimation::Method method) |
target : Qt3DRender::QGeometryRenderer *
Holds the target QGeometryRenderer the morphing animation is applied to.
访问函数:
Qt3DRender::QGeometryRenderer * | target() const |
void | setTarget(Qt3DRender::QGeometryRenderer *target) |
Notifier signal:
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) |
Notifier signal:
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) |
Notifier signal:
void | targetPositionsChanged(const QVector<float> &targetPositions) |
成员函数
QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
Construct a new QMorphingAnimation with parent.
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
Add new morph target at the end of the animation.
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
Return morph weights at positionIndex.
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
Return morph target list.
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
Remove morph target from the animation.
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
Set morph targets to animation. Old targets are cleared.
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
Sets morph weights at positionIndex.