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

The U4DTetrahedron class implements a geometrical representation of a Tetrahedron. More...

Public Member Functions

 U4DTetrahedron ()
 Constructor which creates a tetrahedron with all vertices-components set to zero.
 
 U4DTetrahedron (U4DPoint3n &uPointA, U4DPoint3n &uPointB, U4DPoint3n &uPointC, U4DPoint3n &uPointD)
 Constructor which creates a tetrahedron with the given 3D vertex points.
 
 ~U4DTetrahedron ()
 Destructor for the class.
 
 U4DTetrahedron (const U4DTetrahedron &a)
 Copy constructor for the class.
 
U4DTetrahedronoperator= (const U4DTetrahedron &a)
 Copy constructor for the class. More...
 
bool pointOutsideOfPlane (U4DPoint3n &p, U4DPoint3n &a, U4DPoint3n &b, U4DPoint3n &c)
 Method to test if 3D point p lies outside the plane through abc. The tetrahedron should have a CCW winding. More...
 
bool pointOutsideOfPlane (U4DPoint3n &p, U4DPoint3n &a, U4DPoint3n &b, U4DPoint3n &c, U4DPoint3n &d)
 Method to test if 3D point p and d lies outside the plane through abc. The tetrahedron should have a CCW winding. If the winding is not known, then use this method to test if a point lies outside the plane. More...
 
U4DPoint3n closestPointOnTetrahedronToPoint (U4DPoint3n &uPoint)
 Method which computes the closest 3D point to the tetrahedron from the given 3D point. More...
 
U4DTriangle closestTriangleOnTetrahedronToPoint (U4DPoint3n &uPoint)
 Method which computes the closest tetrahedron face to the given 3D point. More...
 
bool isPointInTetrahedron (U4DPoint3n &uPoint)
 Method which determines if a 3D point lies on the tetrahedron. More...
 
void getBarycentricCoordinatesOfPoint (U4DPoint3n &uPoint, float &baryCoordinateU, float &baryCoordinateV, float &baryCoordinateW, float &baryCoordinateX)
 Method which computes the barycentric coordinates of the 3D point in the tetrahedron. More...
 
std::vector< U4DTrianglegetTriangles ()
 Method which returns the face triangles composing the tetrahedron. More...
 
void show ()
 Method which prints the vertices of the tetrahedron to the console log window.
 
bool isValid ()
 Method which determines if the Tetrahedron has a valid construction. More...
 

Detailed Description

The U4DTetrahedron class implements a geometrical representation of a Tetrahedron.

Member Function Documentation

◆ closestPointOnTetrahedronToPoint()

U4DPoint3n U4DEngine::U4DTetrahedron::closestPointOnTetrahedronToPoint ( U4DPoint3n uPoint)

Method which computes the closest 3D point to the tetrahedron from the given 3D point.

Parameters
uPoint3D point to compute closest 3D point to tetrahedron
Returns
Returns the closest 3D point to the tetrahedron

◆ closestTriangleOnTetrahedronToPoint()

U4DTriangle U4DEngine::U4DTetrahedron::closestTriangleOnTetrahedronToPoint ( U4DPoint3n uPoint)

Method which computes the closest tetrahedron face to the given 3D point.

Parameters
uPoint3D point to compute closest face to tetrahedron
Returns
Returns the closest tetrahedron face to the 3D point

◆ getBarycentricCoordinatesOfPoint()

void U4DEngine::U4DTetrahedron::getBarycentricCoordinatesOfPoint ( U4DPoint3n uPoint,
float &  baryCoordinateU,
float &  baryCoordinateV,
float &  baryCoordinateW,
float &  baryCoordinateX 
)

Method which computes the barycentric coordinates of the 3D point in the tetrahedron.

Parameters
uPoint3D point to compute barycentric coordinates from
baryCoordinateUu-component of the barycentric coordinates of the 3D point
baryCoordinateVv-component of the barycentric coordinates of the 3D point
baryCoordinateWw-component of the barycentric coordinates of the 3D point
baryCoordinateXx-component of the barycentric coordinates of the 3D point

◆ getTriangles()

std::vector< U4DTriangle > U4DEngine::U4DTetrahedron::getTriangles ( )

Method which returns the face triangles composing the tetrahedron.

Returns
Returns the faces of the tetrahedron

◆ isPointInTetrahedron()

bool U4DEngine::U4DTetrahedron::isPointInTetrahedron ( U4DPoint3n uPoint)

Method which determines if a 3D point lies on the tetrahedron.

Parameters
uPoint3D point to test
Returns
Returns true if the 3D point lies on or in the tetrahedron

◆ isValid()

bool U4DEngine::U4DTetrahedron::isValid ( )

Method which determines if the Tetrahedron has a valid construction.

Returns
Returns true if the tetrahedron is valid

◆ operator=()

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

Copy constructor for the class.

Parameters
a3D tetrahedron to copy to
Returns
Returns a copy of the tetrahedron

◆ pointOutsideOfPlane() [1/2]

bool U4DEngine::U4DTetrahedron::pointOutsideOfPlane ( U4DPoint3n p,
U4DPoint3n a,
U4DPoint3n b,
U4DPoint3n c 
)

Method to test if 3D point p lies outside the plane through abc. The tetrahedron should have a CCW winding.

Parameters
U4DPoint3n&p3D point to test
a3D point composing face
b3D point composing face
c3D point composing face
Returns
Returns true if 3D point lies outside the plane through abc

◆ pointOutsideOfPlane() [2/2]

bool U4DEngine::U4DTetrahedron::pointOutsideOfPlane ( U4DPoint3n p,
U4DPoint3n a,
U4DPoint3n b,
U4DPoint3n c,
U4DPoint3n d 
)

Method to test if 3D point p and d lies outside the plane through abc. The tetrahedron should have a CCW winding. If the winding is not known, then use this method to test if a point lies outside the plane.

Parameters
U4DPoint3n&p3D point to test
a3D point composing face
b3D point composing face
c3D point composing face
d3D point to test
Returns
Returns true if 3D point p and d lies outside the plane through abc