Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DOBB Class Reference

The U4DOBB class implements a represenatation of an Oriented-Bounding Box. More...

Public Member Functions

 U4DOBB ()
 Constructor which creates an OBB with zero halfwidth, center at zero position, with an identity orientation.
 
 U4DOBB (U4DVector3n &uHalfWidth)
 Constructor which createas an OBB with the given halfwidth, center at zero position, with an identity orientation.
 
 U4DOBB (U4DVector3n &uHalfWidth, U4DVector3n &uCenter, U4DMatrix3n &uOrientation)
 Constructor which creates an OBB with the given halfwidth, center position and orientation.
 
 ~U4DOBB ()
 Destructor for the class.
 
bool intersectionWithVolume (U4DPlane &uPlane)
 Method which testes if the OBB intersects with a 3D plane. More...
 
bool intersectionWithVolume (U4DOBB *uOBB)
 Method which tests if OBB intersects another OBB. More...
 
U4DVector3n closestPointToOBB (U4DVector3n &uPoint)
 Method which computes closest 3D vector to OBB from a given 3D point. More...
 
float sqDistPointOBB (U4DVector3n &uPoint)
 Method which computes the square magnitude between a 3D point and a OBB. More...
 
std::vector< U4DVector3ncomputeVertexIntersectingPlane (U4DPlane &uPlane)
 Method which computes 3D vector produced by a intersecting plane. More...
 
void setHalfwidth (U4DVector3n &uHalfwidth)
 Method which sets the OBB vector halfwidth. More...
 

Public Attributes

U4DVector3n halfwidth
 Positive halfwidth of the OBB along each axis. More...
 
U4DMatrix3n orientation
 Matrix containing the local orientation of the OBB. More...
 
U4DVector3n center
 3D Vector containing the center point of the OBB More...
 

Detailed Description

The U4DOBB class implements a represenatation of an Oriented-Bounding Box.

Member Function Documentation

◆ closestPointToOBB()

U4DVector3n U4DEngine::U4DOBB::closestPointToOBB ( U4DVector3n uPoint)

Method which computes closest 3D vector to OBB from a given 3D point.

Parameters
uPoint3D point to compute proximity
Returns
Returns the closest 3D vector to OBB

◆ computeVertexIntersectingPlane()

std::vector< U4DVector3n > U4DEngine::U4DOBB::computeVertexIntersectingPlane ( U4DPlane uPlane)

Method which computes 3D vector produced by a intersecting plane.

Parameters
uPlane3D plane to compute intersection
Returns
Returns intersecting vectors produced by the plane intersection

◆ intersectionWithVolume() [1/2]

bool U4DEngine::U4DOBB::intersectionWithVolume ( U4DOBB uOBB)

Method which tests if OBB intersects another OBB.

Parameters
uOBBOBB to test intersection
Returns
Returns true if OBB intersects another OBB

◆ intersectionWithVolume() [2/2]

bool U4DEngine::U4DOBB::intersectionWithVolume ( U4DPlane uPlane)

Method which testes if the OBB intersects with a 3D plane.

Parameters
uPlane3D plane to test intersection
Returns
Returns true if OBB intersects with 3D plane

◆ setHalfwidth()

void U4DEngine::U4DOBB::setHalfwidth ( U4DVector3n uHalfwidth)

Method which sets the OBB vector halfwidth.

Parameters
uHalfwidthVector halfwidth for the OBB

◆ sqDistPointOBB()

float U4DEngine::U4DOBB::sqDistPointOBB ( U4DVector3n uPoint)

Method which computes the square magnitude between a 3D point and a OBB.

Parameters
uPoint3D point to compute square magnitude
Returns
Returns square magnitude of 3D point to OBB. That is, it does not compute the square root of the magnitude

Member Data Documentation

◆ center

U4DVector3n U4DEngine::U4DOBB::center

3D Vector containing the center point of the OBB

◆ halfwidth

U4DVector3n U4DEngine::U4DOBB::halfwidth

Positive halfwidth of the OBB along each axis.

◆ orientation

U4DMatrix3n U4DEngine::U4DOBB::orientation

Matrix containing the local orientation of the OBB.