Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3 (const QSSGBoxPoints &points)
 Construct from QSSGBoxPoints.
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/4]

Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( )

Default constructor, using empty bounds.

Definition at line 200 of file qssgbounds3_p.h.

◆ QSSGBounds3() [2/4]

Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( Qt::Initialization )

Construct uninitialized.

Definition at line 206 of file qssgbounds3_p.h.

◆ QSSGBounds3() [3/4]

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

Construct from two bounding points.

Definition at line 209 of file qssgbounds3_p.h.

◆ QSSGBounds3() [4/4]

Q_DECL_CONSTEXPR Q_ALWAYS_INLINE QSSGBounds3::QSSGBounds3 ( const QSSGBoxPoints & points)

Construct from QSSGBoxPoints.

Definition at line 214 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.

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

◆ center() [1/2]

Q_ALWAYS_INLINE QVector3D QSSGBounds3::center ( ) const

returns the center of this axis aligned box.

Definition at line 287 of file qssgbounds3_p.h.

◆ 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 293 of file qssgbounds3_p.h.

◆ 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 222 of file qssgbounds3_p.h.

◆ 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 261 of file qssgbounds3_p.h.

◆ dimensions()

Q_ALWAYS_INLINE QVector3D QSSGBounds3::dimensions ( ) const

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

Definition at line 305 of file qssgbounds3_p.h.

◆ extents() [1/2]

Q_ALWAYS_INLINE QVector3D QSSGBounds3::extents ( ) const

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

Definition at line 311 of file qssgbounds3_p.h.

◆ 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 299 of file qssgbounds3_p.h.

◆ fatten()

Q_ALWAYS_INLINE void QSSGBounds3::fatten ( double distance)

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

Definition at line 323 of file qssgbounds3_p.h.

◆ getSupport()

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

Returns the support point in a given direction

Definition at line 66 of file qssgbounds3.cpp.

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

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

◆ 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 248 of file qssgbounds3_p.h.

◆ 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 255 of file qssgbounds3_p.h.

◆ isEmpty()

Q_ALWAYS_INLINE bool QSSGBounds3::isEmpty ( ) const

Definition at line 241 of file qssgbounds3_p.h.

◆ isFinite()

bool QSSGBounds3::isFinite ( ) const

checks that the AABB values are not NaN

Definition at line 22 of file qssgbounds3.cpp.

◆ 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 269 of file qssgbounds3_p.h.

◆ scale()

Q_ALWAYS_INLINE void QSSGBounds3::scale ( float scale)

scales the AABB.

Parameters
scaleFactor to scale AABB by.

Definition at line 317 of file qssgbounds3_p.h.

◆ setEmpty()

Q_ALWAYS_INLINE void QSSGBounds3::setEmpty ( )

Sets empty to true.

Definition at line 227 of file qssgbounds3_p.h.

◆ setInfinite()

Q_ALWAYS_INLINE void QSSGBounds3::setInfinite ( )

Sets infinite bounds.

Definition at line 234 of file qssgbounds3_p.h.

◆ toQSSGBoxPoints()

Q_ALWAYS_INLINE QSSGBoxPoints QSSGBounds3::toQSSGBoxPoints ( ) const

Verifies that the bounds is non-empty.

Definition at line 345 of file qssgbounds3_p.h.

◆ toQSSGBoxPointsNoEmptyCheck()

Q_ALWAYS_INLINE QSSGBoxPoints QSSGBounds3::toQSSGBoxPointsNoEmptyCheck ( ) const

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

Definition at line 330 of file qssgbounds3_p.h.

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

◆ transform() [2/2]

void QSSGBounds3::transform ( const QMatrix4x4 & inMatrix)

Definition at line 56 of file qssgbounds3.cpp.

Member Data Documentation

◆ maximum

QVector3D QSSGBounds3::maximum

Definition at line 197 of file qssgbounds3_p.h.

◆ minimum

QVector3D QSSGBounds3::minimum

Definition at line 196 of file qssgbounds3_p.h.


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