Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
sv::AxisAlignedBox Class Reference

An axis-aligned box typically used for bounding box and intersection calculations. More...

#include <sceneview/axis_aligned_box.hpp>

Public Member Functions

 AxisAlignedBox ()
 Constructs an invalid box. More...
 
 AxisAlignedBox (const QVector3D &min, const QVector3D &max)
 Constructs a box with the specified extents.
 
void SetBounds (const QVector3D &min, const QVector3D &max)
 Manually set the box extents.
 
void IncludePoint (const QVector3D &point)
 Modifies the box to contain the specified point.
 
void IncludeBox (const AxisAlignedBox &other)
 Modifies the box to fully contain the specified other box.
 
bool Valid () const
 Check if the box is valid or not. More...
 
const QVector3D & Min () const
 Returns the box corner with lowest coordinates.
 
const QVector3D & Max () const
 Returns the box corner with greatest coordinates.
 
AxisAlignedBox Transformed (const QMatrix4x4 &transform) const
 Transforms and axis-aligns the corners of this box.
 
AxisAlignedBox Intersection (const AxisAlignedBox &other) const
 Computes the intersection of this box with another. More...
 
bool Intersects (const AxisAlignedBox &other) const
 Check if this box intersects with another.
 
bool operator== (const AxisAlignedBox &other) const
 Check if this box is identical to another.
 
bool operator!= (const AxisAlignedBox &other) const
 
QString ToString () const
 For debugging.
 

Detailed Description

An axis-aligned box typically used for bounding box and intersection calculations.

Constructor & Destructor Documentation

sv::AxisAlignedBox::AxisAlignedBox ( )

Constructs an invalid box.

The box can be made valid by including at least one point (e.g., by calling IncludePoint() with a finite value).

Member Function Documentation

AxisAlignedBox sv::AxisAlignedBox::Intersection ( const AxisAlignedBox other) const

Computes the intersection of this box with another.

If the intersection is empty, then an invalid box is returned.

bool sv::AxisAlignedBox::Valid ( ) const

Check if the box is valid or not.

Boxes with negative volume are considered invalid.


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