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

The U4DAABB class implements a mathematical representation of an Axis-Aligned Bounding Box. More...

Public Member Functions

 U4DAABB ()
 Constructor which creates a AABB with minimum 3D point location, maximum 3D point location and longest Dimension 3D vector set to zero.
 
 U4DAABB (U4DPoint3n &uMinPoint, U4DPoint3n &uMaxPoint)
 Constructor which creates a AABB with given minimum 3D point location and maximum 3D point location.
 
 U4DAABB (float uX, float uY, float uZ, U4DPoint3n &uCenter)
 Constructor which creates a AABB with given minimum 3D point halfwidth.
 
 U4DAABB (const U4DAABB &a)
 Copy constructor for the class. More...
 
U4DAABBoperator= (const U4DAABB &a)
 Copy constructor for the class. More...
 
 ~U4DAABB ()
 Destructor for the class.
 
void setMinPoint (U4DPoint3n &uMinPoint)
 Method which sets the minimum 3D point location for the AABB. More...
 
void setMaxPoint (U4DPoint3n &uMaxPoint)
 Method which sets the maximum 3D point location for the AABB. More...
 
U4DPoint3n getMinPoint ()
 Method which returns the minimum 3D point of the AABB. More...
 
U4DPoint3n getMaxPoint ()
 Method which returns the maximum 3D point of the AABB. More...
 
bool intersectionWithVolume (U4DAABB *uAABB)
 Method which tests the intersection between two AABBs. More...
 
bool intersectionWithVolume (U4DSphere &uSphere)
 Method which test an intersection between an AABB and a sphere. More...
 
bool intersectionWithVolume (U4DSphere &uSphere, U4DPoint3n &uPoint)
 Method which test an intersection between an AABB and a sphere. More...
 
void setLongestAABBDimensionVector (U4DVector3n &uLongestAABBDimensionVector)
 Method which sets the longest Dimension vector of the AABB. More...
 
U4DVector3n getLongestAABBDimensionVector ()
 Method which returns the longest dimension vector of the AABB. More...
 
float squareDistanceToPoint (U4DPoint3n &uPoint)
 Method which computes the square magnitude(distance) of a 3D point to the AABB. More...
 
bool intersectionWithSegment (U4DSegment &uSegment)
 Compute if the AABB is intersecting with a segment. More...
 
U4DPoint3n getCenter ()
 Gets the center point of the AABB. More...
 
bool isPointInsideAABB (U4DPoint3n &uPoint)
 Computes if 3D point is within the AABB. More...
 
U4DVector3n getHalfWidth ()
 Gets the halfwidth of the AABB. More...
 
bool intersectionWithTriangle (U4DTriangle &uTriangle)
 determines intersection with triangle More...
 
bool intersectionWithPlane (U4DPlane &uPlane)
 tests intersection with of AABB with plane More...
 
void closestPointOnAABBToPoint (U4DPoint3n &uPoint, U4DPoint3n &uClosestPoint)
 Computes the closest point on the AABB to an specified point. More...
 
bool aabbPlanePointLies (U4DPoint3n &uPoint, U4DPlane &uPlane)
 determines the aabb plane the point lies. Recall that the AABB contains 6 planes More...
 

Public Attributes

U4DPoint3n minPoint
 Minimum 3D point location of the AABB.
 
U4DPoint3n maxPoint
 Maximum 3D point location of the AABB.
 

Detailed Description

The U4DAABB class implements a mathematical representation of an Axis-Aligned Bounding Box.

Constructor & Destructor Documentation

◆ U4DAABB()

U4DEngine::U4DAABB::U4DAABB ( const U4DAABB a)

Copy constructor for the class.

Parameters
aAABB to copy to

Member Function Documentation

◆ aabbPlanePointLies()

bool U4DEngine::U4DAABB::aabbPlanePointLies ( U4DPoint3n uPoint,
U4DPlane uPlane 
)

determines the aabb plane the point lies. Recall that the AABB contains 6 planes

Parameters
uPointpoint to determine in which plane it lies
uPlaneplane where the given point lies
Returns
true if the point lies on any of the 6 planes of the aabb

◆ closestPointOnAABBToPoint()

void U4DEngine::U4DAABB::closestPointOnAABBToPoint ( U4DPoint3n uPoint,
U4DPoint3n uClosestPoint 
)

Computes the closest point on the AABB to an specified point.

Parameters
uPointPoint provided by the user
uClosestPointClosest point to the provided point

◆ getCenter()

U4DPoint3n U4DEngine::U4DAABB::getCenter ( )

Gets the center point of the AABB.

Returns
center point

◆ getHalfWidth()

U4DVector3n U4DEngine::U4DAABB::getHalfWidth ( )

Gets the halfwidth of the AABB.

Returns
halfwidth vector

◆ getLongestAABBDimensionVector()

U4DVector3n U4DEngine::U4DAABB::getLongestAABBDimensionVector ( )

Method which returns the longest dimension vector of the AABB.

Returns
Returns the longest dimension vector of the AABB

◆ getMaxPoint()

U4DPoint3n U4DEngine::U4DAABB::getMaxPoint ( )

Method which returns the maximum 3D point of the AABB.

Returns
Returns the maximum 3D point of the AABB

◆ getMinPoint()

U4DPoint3n U4DEngine::U4DAABB::getMinPoint ( )

Method which returns the minimum 3D point of the AABB.

Returns
Returns the minimum 3D point of the AABB

◆ intersectionWithPlane()

bool U4DEngine::U4DAABB::intersectionWithPlane ( U4DPlane uPlane)

tests intersection with of AABB with plane

Parameters
uPlaneplane to test intersection
Returns
true if AABB intersects the plane

◆ intersectionWithSegment()

bool U4DEngine::U4DAABB::intersectionWithSegment ( U4DSegment uSegment)

Compute if the AABB is intersecting with a segment.

Parameters
uSegmentsegment
Returns
true if intersection occurs

◆ intersectionWithTriangle()

bool U4DEngine::U4DAABB::intersectionWithTriangle ( U4DTriangle uTriangle)

determines intersection with triangle

Parameters
uTriangletriangle to test intersection
Returns
true if the aabb intersects with the triangle

◆ intersectionWithVolume() [1/3]

bool U4DEngine::U4DAABB::intersectionWithVolume ( U4DAABB uAABB)

Method which tests the intersection between two AABBs.

Parameters
uAABBAABB object to test intersection with
Returns
Returns true if two AABBs intersection occurred

◆ intersectionWithVolume() [2/3]

bool U4DEngine::U4DAABB::intersectionWithVolume ( U4DSphere uSphere)

Method which test an intersection between an AABB and a sphere.

Parameters
uSphereSphere object to test intersection with
Returns
Returns true if an intersection between an AABB and a sphere occurred

◆ intersectionWithVolume() [3/3]

bool U4DEngine::U4DAABB::intersectionWithVolume ( U4DSphere uSphere,
U4DPoint3n uPoint 
)

Method which test an intersection between an AABB and a sphere.

Parameters
uSphereSphere object to test intersection with
uPointpoint closest to intersection on AABB
Returns
Returns true if an intersection between an AABB and a sphere occurred

◆ isPointInsideAABB()

bool U4DEngine::U4DAABB::isPointInsideAABB ( U4DPoint3n uPoint)

Computes if 3D point is within the AABB.

Parameters
uPoint3D point
Returns
true if point lies within the AABB

◆ operator=()

U4DAABB & U4DEngine::U4DAABB::operator= ( const U4DAABB a)

Copy constructor for the class.

Parameters
aAABB to copy to
Returns
returns a copy of the AABB

◆ setLongestAABBDimensionVector()

void U4DEngine::U4DAABB::setLongestAABBDimensionVector ( U4DVector3n uLongestAABBDimensionVector)

Method which sets the longest Dimension vector of the AABB.

Parameters
uLongestAABBDimensionVectorLongest dimension vector of the AABB

◆ setMaxPoint()

void U4DEngine::U4DAABB::setMaxPoint ( U4DPoint3n uMaxPoint)

Method which sets the maximum 3D point location for the AABB.

Parameters
uMaxPointMaximum 3D point location

◆ setMinPoint()

void U4DEngine::U4DAABB::setMinPoint ( U4DPoint3n uMinPoint)

Method which sets the minimum 3D point location for the AABB.

Parameters
uMinPointMinimum 3D point location

◆ squareDistanceToPoint()

float U4DEngine::U4DAABB::squareDistanceToPoint ( U4DPoint3n uPoint)

Method which computes the square magnitude(distance) of a 3D point to the AABB.

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