Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSSGBounds3 Class Reference

Class representing 3D range or axis aligned bounding box. More...

#include <qssgbounds3_p.h>

+ Collaboration diagram for QSSGBounds3:

Public Member Functions

Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3 ()
 Default constructor, using empty bounds.
 
Q_ALWAYS_INLINE QSSGBounds3 (Qt::Initialization)
 Construct uninitialized.
 
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3 (const QVector3D &minimum, const QVector3D &maximum)
 Construct from two bounding points.
 
Q_ALWAYS_INLINE void setEmpty ()
 Sets empty to true.
 
Q_ALWAYS_INLINE void setInfinite ()
 Sets infinite bounds.
 
void include (const QVector3D &v)
 expands the volume to include v
 
void include (const QSSGBounds3 &b)
 expands the volume to include b.
 
Q_ALWAYS_INLINE bool isEmpty () const
 
Q_ALWAYS_INLINE bool intersects (const QSSGBounds3 &b) const
 indicates whether the intersection of this and b is empty or not.
 
Q_ALWAYS_INLINE bool intersects1D (const QSSGBounds3 &a, quint32 axis) const
 computes the 1D-intersection between two AABBs, on a given axis.
 
Q_ALWAYS_INLINE bool contains (const QVector3D &v) const
 indicates if these bounds contain v.
 
Q_ALWAYS_INLINE bool isInside (const QSSGBounds3 &box) const
 checks a box is inside another box.
 
Q_ALWAYS_INLINE QVector3D center () const
 returns the center of this axis aligned box.
 
Q_ALWAYS_INLINE float center (quint32 axis) const
 get component of the box's center along a given axis
 
Q_ALWAYS_INLINE float extents (quint32 axis) const
 get component of the box's extents along a given axis
 
Q_ALWAYS_INLINE QVector3D dimensions () const
 returns the dimensions (width/height/depth) of this axis aligned box.
 
Q_ALWAYS_INLINE QVector3D extents () const
 returns the extents, which are half of the width/height/depth.
 
Q_ALWAYS_INLINE void scale (float scale)
 scales the AABB.
 
Q_ALWAYS_INLINE void fatten (double distance)
 
bool isFinite () const
 
Q_ALWAYS_INLINE QSSGBoxPoints toQSSGBoxPointsNoEmptyCheck () const
 
Q_ALWAYS_INLINE QSSGBoxPoints toQSSGBoxPoints () const
 
void transform (const QMatrix4x4 &inMatrix)
 
QVector3D getSupport (const QVector3D &direction) const
 

Static Public Member Functions

static Q_ALWAYS_INLINE QSSGBounds3 boundsOfPoints (const QVector3D &v0, const QVector3D &v1)
 returns the AABB containing v0 and v1.
 
static Q_ALWAYS_INLINE QSSGBounds3 centerExtents (const QVector3D &center, const QVector3D &extent)
 returns the AABB from center and extents vectors.
 
static Q_ALWAYS_INLINE QSSGBounds3 basisExtent (const QVector3D &center, const QMatrix3x3 &basis, const QVector3D &extent)
 Construct from center, extent, and (not necessarily orthogonal) basis.
 
static QSSGBounds3 transform (const QMatrix3x3 &matrix, const QSSGBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 

Public Attributes

QVector3D minimum
 
QVector3D maximum
 

Detailed Description

Class representing 3D range or axis aligned bounding box.

Stored as minimum and maximum extent corners. Alternate representation would be center and dimensions. May be empty or nonempty. If not empty, minimum <= maximum has to hold.

Definition at line 40 of file qssgbounds3_p.h.

Constructor & Destructor Documentation

◆ QSSGBounds3() [1/3]

Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( )

Default constructor, using empty bounds.

Definition at line 195 of file qssgbounds3_p.h.

Referenced by basisExtent(), boundsOfPoints(), and centerExtents().

+ Here is the caller graph for this function:

◆ QSSGBounds3() [2/3]

Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( Qt::Initialization )

Construct uninitialized.

Definition at line 201 of file qssgbounds3_p.h.

◆ QSSGBounds3() [3/3]

Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( const QVector3D & minimum,
const QVector3D & maximum )

Construct from two bounding points.

Definition at line 204 of file qssgbounds3_p.h.

Member Function Documentation

◆ basisExtent()

QSSGBounds3 QSSGBounds3::basisExtent ( const QVector3D & center,
const QMatrix3x3 & basis,
const QVector3D & extent )
static

Construct from center, extent, and (not necessarily orthogonal) basis.

Definition at line 32 of file qssgbounds3.cpp.

References QSSGBounds3(), c2, center(), qAbs(), QVector3D::setX(), QVector3D::x(), QVector3D::y(), and QVector3D::z().

Referenced by transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ boundsOfPoints()

QSSGBounds3 QSSGBounds3::boundsOfPoints ( const QVector3D & v0,
const QVector3D & v1 )
static

returns the AABB containing v0 and v1.

Parameters
v0first point included in the AABB.
v1second point included in the AABB.

Definition at line 27 of file qssgbounds3.cpp.

References QSSGBounds3(), QSSGUtils::vec3::maximum(), and QSSGUtils::vec3::minimum().

+ Here is the call graph for this function:

◆ center() [1/2]

Q_ALWAYS_INLINE QVector3D QSSGBounds3::center ( ) const

returns the center of this axis aligned box.

Definition at line 274 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

Referenced by basisExtent(), centerExtents(), getSupport(), QSSGLayerRenderData::prepareParticlesForRender(), scale(), and transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ center() [2/2]

Q_ALWAYS_INLINE float QSSGBounds3::center ( quint32 axis) const

get component of the box's center along a given axis

Definition at line 280 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

+ Here is the call graph for this function:

◆ centerExtents()

Q_ALWAYS_INLINE QSSGBounds3 QSSGBounds3::centerExtents ( const QVector3D & center,
const QVector3D & extent )
static

returns the AABB from center and extents vectors.

Parameters
centerCenter vector
extentExtents vector

Definition at line 209 of file qssgbounds3_p.h.

References QSSGBounds3(), and center().

Referenced by QSSGLayerRenderData::prepareReflectionProbesForRender(), and scale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contains()

Q_ALWAYS_INLINE bool QSSGBounds3::contains ( const QVector3D & v) const

indicates if these bounds contain v.

Parameters
vPoint to test against bounds.

Definition at line 248 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, Q_ASSERT, QVector3D::x(), QVector3D::y(), and QVector3D::z().

+ Here is the call graph for this function:

◆ dimensions()

Q_ALWAYS_INLINE QVector3D QSSGBounds3::dimensions ( ) const

returns the dimensions (width/height/depth) of this axis aligned box.

Definition at line 292 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

Referenced by extents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extents() [1/2]

Q_ALWAYS_INLINE QVector3D QSSGBounds3::extents ( ) const

returns the extents, which are half of the width/height/depth.

Definition at line 298 of file qssgbounds3_p.h.

References dimensions(), isFinite(), and Q_ASSERT.

Referenced by getSupport(), and scale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extents() [2/2]

Q_ALWAYS_INLINE float QSSGBounds3::extents ( quint32 axis) const

get component of the box's extents along a given axis

Definition at line 286 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

Referenced by transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fatten()

Q_ALWAYS_INLINE void QSSGBounds3::fatten ( double distance)

fattens the AABB in all 3 dimensions by the given distance.

Definition at line 310 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

+ Here is the call graph for this function:

◆ getSupport()

QVector3D QSSGBounds3::getSupport ( const QVector3D & direction) const

Returns the support point in a given direction

Definition at line 66 of file qssgbounds3.cpp.

References center(), direction, extents(), QVector3D::x(), QVector3D::y(), and QVector3D::z().

Referenced by QSSGLayerRenderData::prepareModelsForRender().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ include() [1/2]

void QSSGBounds3::include ( const QSSGBounds3 & b)

expands the volume to include b.

Parameters
bBounds to perform union with.

Definition at line 16 of file qssgbounds3.cpp.

References maximum, QSSGUtils::vec3::maximum(), minimum, and QSSGUtils::vec3::minimum().

+ Here is the call graph for this function:

◆ include() [2/2]

QT_BEGIN_NAMESPACE void QSSGBounds3::include ( const QVector3D & v)

expands the volume to include v

Parameters
vPoint to expand to.

Definition at line 10 of file qssgbounds3.cpp.

References maximum, QSSGUtils::vec3::maximum(), minimum, and QSSGUtils::vec3::minimum().

Referenced by calculateShadowCameraBoundingBox(), QSSGRendererPrivate::intersectRayWithSubsetRenderable(), and transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersects()

Q_ALWAYS_INLINE bool QSSGBounds3::intersects ( const QSSGBounds3 & b) const

indicates whether the intersection of this and b is empty or not.

Parameters
bBounds to test for intersection.

Definition at line 235 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, Q_ASSERT, QVector3D::x(), QVector3D::y(), and QVector3D::z().

+ Here is the call graph for this function:

◆ intersects1D()

Q_ALWAYS_INLINE bool QSSGBounds3::intersects1D ( const QSSGBounds3 & a,
quint32 axis ) const

computes the 1D-intersection between two AABBs, on a given axis.

Parameters
athe other AABB
axisthe axis (0, 1, 2)

Definition at line 242 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, and Q_ASSERT.

+ Here is the call graph for this function:

◆ isEmpty()

Q_ALWAYS_INLINE bool QSSGBounds3::isEmpty ( ) const

Definition at line 228 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, Q_ASSERT, QVector3D::x(), QVector3D::y(), and QVector3D::z().

Referenced by toQSSGBoxPoints(), transform(), and transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFinite()

bool QSSGBounds3::isFinite ( ) const

checks that the AABB values are not NaN

Definition at line 22 of file qssgbounds3.cpp.

References QSSGUtils::vec3::isFinite(), maximum, and minimum.

Referenced by center(), center(), contains(), dimensions(), extents(), extents(), fatten(), intersects(), intersects1D(), isEmpty(), isInside(), and scale().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInside()

Q_ALWAYS_INLINE bool QSSGBounds3::isInside ( const QSSGBounds3 & box) const

checks a box is inside another box.

Parameters
boxthe other AABB

Definition at line 256 of file qssgbounds3_p.h.

References isFinite(), maximum, minimum, Q_ASSERT, QVector3D::x(), QVector3D::y(), and QVector3D::z().

+ Here is the call graph for this function:

◆ scale()

Q_ALWAYS_INLINE void QSSGBounds3::scale ( float scale)

scales the AABB.

Parameters
scaleFactor to scale AABB by.

Definition at line 304 of file qssgbounds3_p.h.

References center(), centerExtents(), extents(), isFinite(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ setEmpty()

Q_ALWAYS_INLINE void QSSGBounds3::setEmpty ( )

Sets empty to true.

Definition at line 214 of file qssgbounds3_p.h.

References maximum, and minimum.

Referenced by QSSGRenderGeometry::clear(), QSSGRenderGeometry::clearVertexAndIndex(), and transform().

+ Here is the caller graph for this function:

◆ setInfinite()

Q_ALWAYS_INLINE void QSSGBounds3::setInfinite ( )

Sets infinite bounds.

Definition at line 221 of file qssgbounds3_p.h.

References maximum, and minimum.

◆ toQSSGBoxPoints()

Q_ALWAYS_INLINE QSSGBoxPoints QSSGBounds3::toQSSGBoxPoints ( ) const

Verifies that the bounds is non-empty.

Definition at line 332 of file qssgbounds3_p.h.

References isEmpty(), and toQSSGBoxPointsNoEmptyCheck().

+ Here is the call graph for this function:

◆ toQSSGBoxPointsNoEmptyCheck()

Q_ALWAYS_INLINE QSSGBoxPoints QSSGBounds3::toQSSGBoxPointsNoEmptyCheck ( ) const

Use when the bounds is already verified to be non-empty!!!

Definition at line 317 of file qssgbounds3_p.h.

References maximum, and minimum.

Referenced by toQSSGBoxPoints(), and transform().

+ Here is the caller graph for this function:

◆ transform() [1/2]

QSSGBounds3 QSSGBounds3::transform ( const QMatrix3x3 & matrix,
const QSSGBounds3 & bounds )
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

Parameters
[in]matrixTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

Definition at line 49 of file qssgbounds3.cpp.

References basisExtent(), center(), extents(), isEmpty(), and QSSGUtils::mat33::transform().

Referenced by QSSGParticlesRenderable::QSSGParticlesRenderable(), QSSGSubsetRenderable::QSSGSubsetRenderable(), and QSSGLayerRenderData::prepareModelsForRender().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transform() [2/2]

void QSSGBounds3::transform ( const QMatrix4x4 & inMatrix)

Definition at line 56 of file qssgbounds3.cpp.

References include(), isEmpty(), setEmpty(), and toQSSGBoxPointsNoEmptyCheck().

+ Here is the call graph for this function:

Member Data Documentation

◆ maximum

◆ minimum


The documentation for this class was generated from the following files: