nlib
nn::nlib::simd::OrientedBox Class Reference

Class for representing oriented bounding boxes (OBB). This class has data members to hold the center coordinates (center), the size in the xyz directions (extent), and the rotation quaternion (rotation). More...

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

Public Member Functions

 OrientedBox () noexcept
 Instantiates the object with default parameters (default constructor). Does not configure the default settings for the data members.
 
void Transform (OrientedBox *box, SimdMatrixArg m) noexcept
 Stores the 3D transformed OBB of an OBB object. More...
 
void GetCorners (Float3 *corners) const noexcept
 Gets the vertex coordinates of an OBB. More...
 

Static Public Member Functions

static void FromAxisAlignedBox (OrientedBox *box, const AxisAlignedBox &aabb) noexcept
 Converts an AABB into an OBB. More...
 

Public Attributes

SimdVector center
 The center coordinates of the OBB. A 3D vector.
 
SimdVector extent
 The size of the x-coordinate, y-coordinate, and z-coordinate of the OBB. All of the elements must have positive values. A 3D vector.
 
SimdQuaternion rotation
 A quaternion representing the orientation of the OBB.
 

Detailed Description

Class for representing oriented bounding boxes (OBB). This class has data members to hold the center coordinates (center), the size in the xyz directions (extent), and the rotation quaternion (rotation).

Description
The object is the AABB defined by (-extent.x, -extent.y, -extent.z), (extent.x, extent.y, extent.z) that has been rotated by the amount of rotation and translated by the amount of center.
In other words, if there is no rotation, and if the sizes in the xyz directions are all 1 with the center coordinates at the origin, it is the same as an AABB with maximum and minimum coordinates of (-1,-1,-1) and (1, 1, 1).
Note that rotation must be a normalized quaternion.

Definition at line 80 of file SimdGeometry.h.

Member Function Documentation

§ FromAxisAlignedBox()

nn::nlib::simd::OrientedBox::FromAxisAlignedBox ( OrientedBox box,
const AxisAlignedBox aabb 
)
staticnoexcept

Converts an AABB into an OBB.

Parameters
[out]boxThe region storing the OBB.
[in]aabbThe region storing the AABB.

§ GetCorners()

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

Gets the vertex coordinates of an OBB.

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

§ Transform()

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

Stores the 3D transformed OBB of an OBB object.

Parameters
[out]boxThe region storing the transformed OBB.
[in]mA 3D transform matrix.

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