Untold Engine
Beta v0.0.16
docs
|
The U4DTriangle class implements a geometrical representation of a 3D triangle. More...
Public Member Functions | |
U4DTriangle () | |
Constructor which creates a 3D triangle with vertices all set to zero components. | |
U4DTriangle (U4DPoint3n &uPointA, U4DPoint3n &uPointB, U4DPoint3n &uPointC) | |
Constructor which creates a 3D triangle with the given vertex points. | |
~U4DTriangle () | |
Destructor for the class. | |
U4DTriangle (const U4DTriangle &a) | |
Copy constructor for the class. | |
U4DTriangle & | operator= (const U4DTriangle &a) |
Copy constructor for the class. More... | |
bool | operator== (const U4DTriangle &a) |
Method which determines if two 3D triangle are equal. That is, they have the same vertex 3D points. More... | |
bool | operator!= (const U4DTriangle &a) |
Method which determines if two 3D triangle are NOT equal. That is, they DO NOT have the same vertex 3D points. More... | |
U4DPoint3n | closestPointOnTriangleToPoint (U4DPoint3n &uPoint) |
Method which determins the closest 3D point on the 3D triangle from the given 3D point. More... | |
U4DPoint3n | getCentroid () |
Method which determines the centroid point of the triangle. More... | |
bool | isPointOnTriangle (U4DPoint3n &uPoint) |
Method which determines if the 3D point lies on the 3D triangle. More... | |
void | getBarycentricCoordinatesOfPoint (U4DPoint3n &uPoint, float &baryCoordinateU, float &baryCoordinateV, float &baryCoordinateW) |
Method which computes the Barycentric coordinates of the 3D point in the triangle. More... | |
U4DVector3n | getTriangleNormal () |
Method which returns a 3D normal vector to the triangle. The normal vector computation follows the right-hand rule. More... | |
std::vector< U4DSegment > | getSegments () |
Method which returns all three vertices of the 3D triangle. More... | |
U4DTriangle | projectTriangleOntoPlane (U4DPlane &uPlane) |
Method which returns a projected 3D triangle to a 3D plane. More... | |
float | distanceToPlane (U4DPlane &uPlane) |
Method which computes the magnitude(distance) from the 3D triangle to a 3D plane. More... | |
float | distanceSquareToPlane (U4DPlane &uPlane) |
Method which computes the square magnitude fromt the 3D triangle to a 3D plane. More... | |
float | centroidDistanceToPlane (U4DPlane &uPlane) |
Method which computes the magnitude(distance) from the 3D triangle's centroid to a 3D plane. More... | |
float | centroidSquareDistanceToPlane (U4DPlane &uPlane) |
Method which computes the square magnitude(distance) from the 3D triangle's centroid to a 3D plane. More... | |
void | show () |
Method which prints the vertices of the 3D triangle to the console log window. | |
bool | isValid () |
Method which test if the 3D triangle is valid. That is, if the points are not colinear. More... | |
Public Attributes | |
U4DPoint3n | pointA |
3D vertex point of the triangle | |
U4DPoint3n | pointB |
3D vertex point of the triangle | |
U4DPoint3n | pointC |
3D vertex point of the triangle | |
The U4DTriangle class implements a geometrical representation of a 3D triangle.
float U4DEngine::U4DTriangle::centroidDistanceToPlane | ( | U4DPlane & | uPlane | ) |
Method which computes the magnitude(distance) from the 3D triangle's centroid to a 3D plane.
uPlane | 3D plane to compute centroid distance from |
float U4DEngine::U4DTriangle::centroidSquareDistanceToPlane | ( | U4DPlane & | uPlane | ) |
Method which computes the square magnitude(distance) from the 3D triangle's centroid to a 3D plane.
uPlane | 3D plane to compute centroid distance from |
U4DPoint3n U4DEngine::U4DTriangle::closestPointOnTriangleToPoint | ( | U4DPoint3n & | uPoint | ) |
Method which determins the closest 3D point on the 3D triangle from the given 3D point.
uPoint | 3D point to determine closest point |
float U4DEngine::U4DTriangle::distanceSquareToPlane | ( | U4DPlane & | uPlane | ) |
Method which computes the square magnitude fromt the 3D triangle to a 3D plane.
uPlane | 3D plane to compute distance |
float U4DEngine::U4DTriangle::distanceToPlane | ( | U4DPlane & | uPlane | ) |
Method which computes the magnitude(distance) from the 3D triangle to a 3D plane.
uPlane | 3D plane to compute distance |
void U4DEngine::U4DTriangle::getBarycentricCoordinatesOfPoint | ( | U4DPoint3n & | uPoint, |
float & | baryCoordinateU, | ||
float & | baryCoordinateV, | ||
float & | baryCoordinateW | ||
) |
Method which computes the Barycentric coordinates of the 3D point in the triangle.
uPoint | 3D point to compute barycentric coordinates from |
baryCoordinateU | u-component of the barycentric coordinates of the 3D point |
baryCoordinateV | v-component of the barycentric coordinates of the 3D point |
baryCoordinateW | w-component of the barycentric coordinates of the 3D point |
U4DPoint3n U4DEngine::U4DTriangle::getCentroid | ( | ) |
Method which determines the centroid point of the triangle.
std::vector< U4DSegment > U4DEngine::U4DTriangle::getSegments | ( | ) |
Method which returns all three vertices of the 3D triangle.
U4DVector3n U4DEngine::U4DTriangle::getTriangleNormal | ( | ) |
Method which returns a 3D normal vector to the triangle. The normal vector computation follows the right-hand rule.
bool U4DEngine::U4DTriangle::isPointOnTriangle | ( | U4DPoint3n & | uPoint | ) |
Method which determines if the 3D point lies on the 3D triangle.
uPoint | 3D point to test |
bool U4DEngine::U4DTriangle::isValid | ( | ) |
Method which test if the 3D triangle is valid. That is, if the points are not colinear.
bool U4DEngine::U4DTriangle::operator!= | ( | const U4DTriangle & | a | ) |
Method which determines if two 3D triangle are NOT equal. That is, they DO NOT have the same vertex 3D points.
a | 3D triangle to test |
U4DTriangle & U4DEngine::U4DTriangle::operator= | ( | const U4DTriangle & | a | ) |
Copy constructor for the class.
a | 3D triangle to copy to |
bool U4DEngine::U4DTriangle::operator== | ( | const U4DTriangle & | a | ) |
Method which determines if two 3D triangle are equal. That is, they have the same vertex 3D points.
a | 3D triangle to test |
U4DTriangle U4DEngine::U4DTriangle::projectTriangleOntoPlane | ( | U4DPlane & | uPlane | ) |
Method which returns a projected 3D triangle to a 3D plane.
uPlane | 3D plane to compute projected 3D triangle |