Qt3DCore::QSkeletonLoader Class
class Qt3DCore::QSkeletonLoader用于从文件中加载关节骨架。更多
头文件: | #include <QSkeletonLoader> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore) target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
qmake: | QT += 3dcore |
在 QML 中: | SkeletonLoader |
继承: | Qt3DCore::QAbstractSkeleton |
状态: | 已废弃 |
公共类型
enum | Status { NotReady, Ready, Error } |
属性
- createJointsEnabled : bool
- source : QUrl
- status : const Status
公共功能
QSkeletonLoader(Qt3DCore::QNode *parent = nullptr) | |
QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr) | |
bool | isCreateJointsEnabled() const |
Qt3DCore::QJoint * | rootJoint() const |
QUrl | source() const |
Qt3DCore::QSkeletonLoader::Status | status() const |
公共插槽
void | setCreateJointsEnabled(bool enabled) |
void | setSource(const QUrl &source) |
信号
void | createJointsEnabledChanged(bool createJointsEnabled) |
void | rootJointChanged(Qt3DCore::QJoint *rootJoint) |
void | sourceChanged(const QUrl &source) |
void | statusChanged(Qt3DCore::QSkeletonLoader::Status status) |
详细说明
如果您希望从文件中加载整个骨骼,而不是自己使用骨骼和关节创建关节,请使用SkeletonLoader 。在三维数字内容创建工具(如 Blender)中创建骨架并将网格顶点绑定到骨架是最简单的操作。生成的骨架和网格可以以合适的格式(如 glTF 2)导出,供Qt 3D 使用。
成员类型文档
enum QSkeletonLoader::Status
该枚举标识骨架的状态。
常量 | 值 | 描述 |
---|---|---|
Qt3DCore::QSkeletonLoader::NotReady | 0 | 骨架尚未加载 |
Qt3DCore::QSkeletonLoader::Ready | 1 | 已成功加载骨架 |
Qt3DCore::QSkeletonLoader::Error | 2 | 加载骨架时发生错误 |
属性文档
createJointsEnabled : bool
该属性包含一个布尔值,用于指示是否启用 createJoints。
访问功能:
bool | isCreateJointsEnabled() const |
void | setCreateJointsEnabled(bool enabled) |
Notifier 信号:
void | createJointsEnabledChanged(bool createJointsEnabled) |
source : QUrl
保存加载骨架的源 URL。
访问功能:
QUrl | source() const |
void | setSource(const QUrl &source) |
通知信号:
void | sourceChanged(const QUrl &source) |
[read-only]
status : const Status
保存骨架加载的当前状态。
访问功能:
Qt3DCore::QSkeletonLoader::Status | status() const |
Notifier 信号:
void | statusChanged(Qt3DCore::QSkeletonLoader::Status status) |
成员函数 文档
[explicit]
QSkeletonLoader::QSkeletonLoader(Qt3DCore::QNode *parent = nullptr)
使用parent 构建一个新的 QSkeletonLoader。
[explicit]
QSkeletonLoader::QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr)
使用parent 构建一个新的 QSkeletonLoader,并设置source 。
bool QSkeletonLoader::isCreateJointsEnabled() const
返回一个布尔值,表示是否启用 CreateJoints。默认值为false
。
注: 属性createJointsEnabled 的获取函数。
Qt3DCore::QJoint *QSkeletonLoader::rootJoint() const
返回构成骨架的关节层次结构中的根关节。
注:rootJoint 属性的获取函数。
© 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.