QMorphingAnimation 类
class Qt3DAnimation::QMorphingAnimation一个实现融合型形状变形动画的类。 更多...
| 头文件 | #include <QMorphingAnimation> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) | 
| qmake | QT += 3danimation | 
| 由以下类实例化: | MorphingAnimation | 
| 继承自: | Qt3DAnimation::QAbstractAnimation | 
公共类型
| 枚举 | 方法 { Normalized, Relative } | 
属性
| 
 | 
 | 
公共函数
| QMorphingAnimation(QObject *parent = nullptr) | |
| void | addMorphTarget(Qt3DAnimation::QMorphTarget *target) | 
| QEasingCurve | easing() const | 
| QVector(radfloat) | getWeights(int positionIndex) | 
| float | interpolator() const | 
| Qt3DAnimation::QMorphingAnimation::Method | method() const | 
| QVector | morphTargetList() | 
| void | removeMorphTarget(Qt3DAnimation::QMorphTarget *target) | 
| void | setMorphTargets(const QVector | 
| void | setWeights(int positionIndex, const QVector | 
| Qt3DRender::QGeometryRenderer * | target() const | 
| QString | targetName() const | 
| QVector(radfloat) | targetPositions() const | 
公共槽函数
| 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) | 
信号
| 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) | 
详细描述
Qt3DAnimation::QMorphingAnimation 类实现了将混合形状变形动画应用到目标 QGeometryRenderer 的功能。QMorphingAnimation 设置从 morph 目标 到目标 QGeometryRenderer::geometry 的正确 QAttributes,并计算当前位置的插值器。在材质中必须实现实际属性间的混合。Qt3DAnimation::QMorphPhongMaterial 实现了支持 phong 光照模型的变形材质。混合发生在2个属性之间 - 'base' 和 'target'。基础属性和目标属性的名称来自变形目标名称,其中基础属性保留原名,目标属性名称在名称后追加 'Target'。插值器可以设置为用于材料的 QParameter。动画中的所有变形目标应包含与基础几何体同名的属性。
成员类型文档
enum QMorphingAnimation::Method
此枚举指定变形方法。
| 常量 | 值 | 描述 | 
|---|---|---|
| Qt3DAnimation::QMorphingAnimation::Normalized | 0 | 混合应使用归一化公式;V'' = Vbase * (1.0 - sum(Wi)) + sum[Vi * Wi] | 
| Qt3DAnimation::QMorphingAnimation::Relative | 1 | 混合应使用相对公式;V'' = Vbase + sum[Vi * Wi] | 
属性文档
easing : QEasingCurve
存储中间变形目标之间的插值器的易用曲线。
访问函数
| QEasingCurve | easing() const | 
| void | setEasing(const QEasingCurve &easing) | 
通知信号
| void | easingChanged(const QEasingCurve &easing) | 
[只读] interpolator : const float
存储基础属性和目标属性之间的插值器。
访问函数
| float | interpolator() const | 
通知信号
| void | interpolatorChanged(float interpolator) | 
method : Method
存储变形方法。默认为 Relative。
访问函数
| Qt3DAnimation::QMorphingAnimation::Method | method() const | 
| void | setMethod(Qt3DAnimation::QMorphingAnimation::Method method) | 
通知信号
| void | methodChanged(Qt3DAnimation::QMorphingAnimation::Method method) | 
target : Qt3DRender::QGeometryRenderer*
包含应用形变动画的目标 QGeometryRenderer。
访问函数
| Qt3DRender::QGeometryRenderer * | target() const | 
| void | setTarget(Qt3DRender::QGeometryRenderer *target) | 
通知信号
| void | targetChanged(Qt3DRender::QGeometryRenderer *target) | 
targetName : QString
包含目标几何体的名称。这是一个便捷属性,使得将目标几何体与形变动画匹配变得更简单。名称通常与目标 QGeometryRenderer 的父实体的名称相同,但不一定是这样。
访问函数
| QString | targetName() const | 
| void | setTargetName(const QString name) | 
通知信号
| void | targetNameChanged(const QString &name) | 
targetPositions : QVector<float>
包含形变目标的位移值。列表中的每个位置指定具有相同索引的对应形变目标的位移。值必须是按顺序排列的。值可以是正数或负数,并且没有预定义的单位。
访问函数
| QVector(radfloat) | targetPositions() const | 
| void | setTargetPositions(const QVector<float> &targetPositions) | 
通知信号
| void | targetPositionsChanged(const QVector<float> &targetPositions) | 
成员函数文档
[显式] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)
使用 parent 构造一个新的 QMorphingAnimation。
void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)
在动画末尾添加新的形变 target。
QVector<float> QMorphingAnimation::getWeights(int positionIndex)
返回 positionIndex 的形变权重。
QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
返回形变目标列表。
void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
从动画中移除形变 target。
void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
将形变 targets 设置到动画中。旧的目标将被清除。
void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
在 positionIndex 处设置形变 weights。
© 2024 Qt 公司有限公司。此处包含的文档贡献归其各自所有者所有。此处提供的文档受《Vu Free Documentation License 版本 1.3》的许可,由自由软件基金会发布。Qt 和相应的标志是芬兰和/或全世界 Qt 公司有限公司的商标。所有其他商标均为其各自所有者的财产。