本页面

Qt Quick 三维物理

Qt Quick 3D Physics 为物理模拟提供了高级 API。它支持模拟交互式刚体以及用于检测重叠的静态网格和非碰撞体。每个模拟体都有自己的物理属性,如质量、密度和摩擦力。

一个场景的截图,显示一个球落在一个由弹珠组成的结构上,破坏了该结构

使用模块

QML API

模块的 QML 类型可通过QtQuick3D.Physics 导入。要使用这些类型,请在 .qml 文件中添加以下导入语句:

import QtQuick3D.Physics

这是一个纯 QML 模块,没有 C++ API。

文章和指南

示例

了解Qt Quick 3D 物理功能的最佳方式是查看示例:

参考资料

注意: 与技术预览版 API(Qt 6.4 版)相比,API 有一些变化。请参阅Qt Quick 3D 物理 API 与技术预览版的区别。

许可和归属

Qt Quick 3D Physics 在The Qt Company 的商业许可下可用。此外,它还遵循GNU 通用公共许可证第 3 版。详情请参见Qt 许可

此外,Qt Quick 3D Physics 包含以下许可下的第三方模块:

NVIDIA PhysX SDK, version PhysX_4.1.2.29882248

BSD 3 条款 "新 "或 "修订 "许可证

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