本页内容

BoundingVolume QML Type

可用于覆盖实体的包围体。更多内容...

Import Statement: import Qt3D.Core 2.12
In C++: QBoundingVolume
Inherited By:

GeometryRenderer

Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

方法

详细说明

实体的包围体常用于许多操作,例如选择或视锥体剔除。它通常通过遍历渲染几何体来计算。

当应用程序已知几何体的范围时,可以使用 BoundingVolume,这样Qt 3D 就不必再进行计算。

边界体积可以以最小和最大范围坐标的形式提供,也可以提供一个单独的、通常更简单的几何体来近似渲染的网格。

当使用最小和最大范围时,在几何体的本机坐标系中,这些坐标被视为轴对齐包围盒的相对角点。

BoundingVolume 还可以用于查询GeometryView 的计算出的边界体积。如果几何体发生变化,implicitMinPoint 和implicitMaxPoint 属性将会更新。请注意,此操作是在后台线程上异步执行的,因此您在读取这些属性之前,应先检查implicitPointsValid 的值。

您可以通过调用updateImplicitBounds 来强制更新隐式边界。此操作将在调用线程上阻塞,直到结果可用为止。

注意: GeometryRenderer 继承自 BoundingVolume,因此既支持读取隐式边界,也支持设置显式边界。

属性文档

implicitMaxPoint : vector3d [read-only]

* * * 存储根据指定视图计算出的边界体积的最大范围。

implicitMinPoint : vector3d [read-only]

* * * 存储根据指定视图计算出的包围体积的最小范围。

implicitPointsValid : bool [read-only]

* * * 如果已为视图分配了名称,且隐式范围属性是最新的,则返回 true。 * *

另请参阅 updateImplicitBounds 。

maxPoint : vector3d

* * * 用户指定的边界体积的最大范围。当设置此参数(并同时设置最小范围)时,系统将在内部使用该范围,以避免根据几何体计算体积。

minPoint : vector3d

* * * 用户指定的边界体积的最小范围。当设置此参数(并同时设置最大*范围)时,系统将在内部使用该参数,以避免根据*几何体计算体积。

view : GeometryView

* * * 保存一个指向 QGeometryView 实例的指针,如果该指针已设置,则将用于 * 计算包围体积。

方法文档

bool updateImplicitBounds()

* * * 更新指定视图的隐式边界。如果计算成功,则返回 *true ,否则返回 false。 * *

注意: 计算在调用线程中进行,对于大型网格,此操作 * 可能需要相当长的时间。

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