QBoundingVolume Class▲
-
Header: Qt3DCore/QBoundingVolume
-
Since: Qt 6.0
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS 3dcore)
target_link_libraries(mytarget PRIVATE Qt6::3dcore)
-
qmake: QT += 3dcore
-
Inherited By: Qt3DRender::QGeometryRenderer and Qt3DRender::QPickingProxy
-
Instantiated By: qml-qt3d-core-boundingvolume.xml
-
Inherits: Qt3DCore::QComponent
-
Inherited By: Qt3DRender::QGeometryRenderer and Qt3DRender::QPickingProxy
Detailed Description▲
An entity's bounding volume is used for many operations such as picking or view frustum culling. It is normally computed by traversing the rendered geometry.
QBoundingVolume can be used when the extent of the geometry is known to the application so that Qt 3D does not have to compute it.
A bounding volume can be provided either as minimum and maximum extent coordinates, or a separate, usually simpler, geometry that approximates the rendered mesh.
When using minimum and maximum extents, these are considered to be the opposite corners of an axis aligned bounding box, in the geometry's local coordinate system.
QBoundingVolume can also be used to query the computed bounding volume of a GeometryView. The implicitMinPoint and implicitMaxPoint properties will be updated if the geometry changes. Note that this is done asynchronously on a background thread so you should check the value of implicitPointsValid before reading them.
You can force the implicit extents to be updated by calling updateImplicitBounds. This will block on the calling thread until the results are available.
GeometryRenderer inherits BoundingVolume and thus supports reading implicit bounds or setting explicit bounds also.
Property Documentation▲
[read-only] implicitMaxPoint : const QVector3D▲
* * * Holds maximum extent of the bounding volume computed from the specified view.
Access functions:
-
implicitMaxPoint() const
Notifier signal:
-
void implicitMaxPointChanged(const &implicitMaxPoint)
[read-only] implicitMinPoint : const QVector3D▲
* * * Holds minimum extent of the bounding volume computed from the specified view.
Access functions:
-
implicitMinPoint() const
Notifier signal:
-
void implicitMinPointChanged(const &implicitMinPoint)
[read-only] implicitPointsValid : const bool▲
* * * True if a view has been assigned and the implicit extent properties are up to date. * *
Access functions:
-
bool areImplicitPointsValid() const
Notifier signal:
-
void implicitPointsValidChanged(bool implicitPointsValid)
See Also▲
See also updateImplicitBounds
maxPoint : QVector3D▲
* * * User specified maximum extent of the bounding volume. When set (along with minimum * extent), this will be used internally to avoid computing the volume from the * geometry.
Access functions:
-
maxPoint() const
-
void setMaxPoint(const &maxPoint)
Notifier signal:
-
void maxPointChanged( maxPoint)
minPoint : QVector3D▲
* * * User specified minimum extent of the bounding volume. When set (along with maximum * extent), this will be used internally to avoid computing the volume from the * geometry.
Access functions:
-
minPoint() const
-
void setMinPoint(const &minPoint)
Notifier signal:
-
void minPointChanged( minPoint)
view : QGeometryView*▲
* * * Holds a pointer to the instance of QGeometryView which will be used, if set, * to compute the bounding volume.
Access functions:
-
*view() const
-
void setView( *view)
Notifier signal:
-
void viewChanged( *view)
Member Function Documentation▲
[explicit] QBoundingVolume::QBoundingVolume(Qt3DCore::QNode *parent = nullptr)▲
Constructs a new QBoundingVolume with parent.
bool QBoundingVolume::updateImplicitBounds()▲
* Updates the implicit bounds of the specified view. Returns * true if the computation succeeded and false otherwise. * *
The calculations are done in the call thread, this * could take significant time for large meshes.