Qt3DAnimation::QMorphTarget Class

class Qt3DAnimation::QMorphTarget

为混合形状动画提供变形目标的类。更多

Header: #include <QMorphTarget>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
在 QML 中: MorphTarget
继承: QObject
状态:已废弃

属性

公共功能

QMorphTarget(QObject *parent = nullptr)
void addAttribute(Qt3DCore::QAttribute *attribute)
QList<Qt3DCore::QAttribute *> attributeList() const
QStringList attributeNames() const
void removeAttribute(Qt3DCore::QAttribute *attribute)
void setAttributes(const QList<Qt3DCore::QAttribute *> &attributes)

信号

void attributeNamesChanged(const QStringList &attributeNames)

静态公共成员

Qt3DAnimation::QMorphTarget *fromGeometry(Qt3DCore::QGeometry *geometry, const QStringList &attributes)

详细描述

Qt3DAnimation::QMorphTarget 类是一个方便的类,它提供了一个QAttributes 的列表,QMorphingAnimation 用它来制作几何体的动画。QMorphTarget 也可以根据现有的Qt3DCore::QGeometry 创建。

属性文档

[read-only] attributeNames : const QStringList

保存变形目标中包含的属性名称列表。

访问功能:

QStringList attributeNames() const

Notifier 信号:

void attributeNamesChanged(const QStringList &attributeNames)

成员函数 文档

[explicit] QMorphTarget::QMorphTarget(QObject *parent = nullptr)

用给定的parent 构建一个 QMorphTarget。

void QMorphTarget::addAttribute(Qt3DCore::QAttribute *attribute)

为变形目标添加attribute 。同名的属性之前必须未添加到 morph target 中。

QList<Qt3DCore::QAttribute *> QMorphTarget::attributeList() const

返回 morph target 中包含的属性列表。

[static invokable] Qt3DAnimation::QMorphTarget *QMorphTarget::fromGeometry(Qt3DCore::QGeometry *geometry, const QStringList &attributes)

根据给定geometry 中的attributes 返回 morph target。

注: 可通过元对象系统和 QML 调用此函数。请参见Q_INVOKABLE

void QMorphTarget::removeAttribute(Qt3DCore::QAttribute *attribute)

从变形目标移除attribute

void QMorphTarget::setAttributes(const QList<Qt3DCore::QAttribute *> &attributes)

attributes 设置为变形目标。旧属性将被清除。

© 2025 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.