nlib
nn::nlib::simd::AxisAlignedBox Class Reference

Class for representing axis-aligned bounding boxes (AABB). The class has data members to hold the minimum coordinates (point_min) and the maximum coordinates (point_max). More...

#include "nn/nlib/simd/SimdGeometry.h"

Public Member Functions

 AxisAlignedBox () noexcept
 Instantiates the object with default parameters (default constructor). Does not configure the default settings for the data members.
 
 AxisAlignedBox (const Float3 &pmin, const Float3 &pmax)
 Constructs an AABB with the specified minimum and maximum coordinates. More...
 
void GetCorners (Float3 *corners) const noexcept
 Writes the vertex coordinates of the AABB. More...
 
void Transform (AxisAlignedBox *box, SimdMatrixArg m) noexcept
 Transforms an AABB using the 4x4 matrix m, and stores the smallest AABB that can encompass that post-transformed shape in box. More...
 

Static Public Member Functions

static void Merge (AxisAlignedBox *box, const AxisAlignedBox &box0, const AxisAlignedBox &box1) noexcept
 Creates the smallest AABB that encompasses two AABBs. More...
 
static void FromSphere (AxisAlignedBox *box, SimdSphereArg sphere) noexcept
 Creates the smallest AABB that encompasses a sphere. More...
 
static void FromPoints (AxisAlignedBox *box, SimdVectorArg point0, SimdVectorArg point1) noexcept
 Creates the smallest AABB that encompasses two points. More...
 
static void FromPoints (AxisAlignedBox *box, const Float3 *points, size_t count) noexcept
 Creates the smallest AABB that encompasses the count number of points. More...
 

Public Attributes

SimdVector point_min
 The minimum coordinates of the AABB. Lane 3 is ignored.
 
SimdVector point_max
 The maximum coordinates of the AABB. Lane 3 is ignored.
 

Detailed Description

Class for representing axis-aligned bounding boxes (AABB). The class has data members to hold the minimum coordinates (point_min) and the maximum coordinates (point_max).

Definition at line 61 of file SimdGeometry.h.

Constructor & Destructor Documentation

§ AxisAlignedBox()

nn::nlib::simd::AxisAlignedBox::AxisAlignedBox ( const Float3 pmin,
const Float3 pmax 
)

Constructs an AABB with the specified minimum and maximum coordinates.

Parameters
[in]pminThe minimum xyz coordinates.
[in]pmaxThe maximum xyz coordinates.

Member Function Documentation

§ FromPoints() [1/2]

nn::nlib::simd::AxisAlignedBox::FromPoints ( AxisAlignedBox box,
SimdVectorArg  point0,
SimdVectorArg  point1 
)
staticnoexcept

Creates the smallest AABB that encompasses two points.

Parameters
[out]boxThe region storing the created AABB.
[in]point0A point in three-dimensional space.
[in]point1A point in three-dimensional space.

§ FromPoints() [2/2]

nn::nlib::simd::AxisAlignedBox::FromPoints ( AxisAlignedBox box,
const Float3 points,
size_t  count 
)
staticnoexcept

Creates the smallest AABB that encompasses the count number of points.

Parameters
[out]boxThe region storing the created AABB.
[in]pointsThe region in three-dimensional space that contains the points.
[in]countThe number of points.

§ FromSphere()

nn::nlib::simd::AxisAlignedBox::FromSphere ( AxisAlignedBox box,
SimdSphereArg  sphere 
)
staticnoexcept

Creates the smallest AABB that encompasses a sphere.

Parameters
[out]boxThe region storing the created AABB.
[in]sphereA sphere in three-dimensional space.

§ GetCorners()

nn::nlib::simd::AxisAlignedBox::GetCorners ( Float3 corners) const
noexcept

Writes the vertex coordinates of the AABB.

Parameters
[out]cornersPointer to the region where the vertex coordinates are written.
Description
Eight sets of vertex coordinates are written by corners, so you need a writable region for them.

§ Merge()

nn::nlib::simd::AxisAlignedBox::Merge ( AxisAlignedBox box,
const AxisAlignedBox box0,
const AxisAlignedBox box1 
)
staticnoexcept

Creates the smallest AABB that encompasses two AABBs.

Parameters
[out]boxThe region storing the AABB encompassing box0 and box1.
[in]box0AABB.
[in]box1AABB.

§ Transform()

nn::nlib::simd::AxisAlignedBox::Transform ( AxisAlignedBox box,
SimdMatrixArg  m 
)
noexcept

Transforms an AABB using the 4x4 matrix m, and stores the smallest AABB that can encompass that post-transformed shape in box.

Parameters
[out]boxThe region storing the AABB after it has been transformed.
[in]mA 3D transform matrix.

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