#include <TWatertightTriangle.h>
|
bool | isIntersecting (const TLineSegment< T > &segment, T *out_hitT, TVector3< T > *out_hitBarycentricCoords) const |
| Checks whether the segment is interseting with this triangle.
|
|
| TBasicTriangle (TVector3< T > vA, TVector3< T > vB, TVector3< T > vC) |
|
| TBasicTriangle (std::array< TVector3< T >, 3 > vertices) |
|
T | getArea () const |
|
TVector3< T > | getFaceNormal () const |
|
TVector3< T > | getCentroid () const |
|
TAABB3D< T > | getAABB () const |
|
T | getAspectRatio () const |
| Calculate aspect ratio of this triangle. For a triangle, its aspect ratio is defined to be the ratio of the circumradius to twice the inradius. The higher the aspect ratio, the narrower the shape of the triangle. A triangle with extreme aspect ratio will look like a needle. The smallest aspect ratio possible is 1 (an equilateral triangle), while the largest possible aspect ratio is infinity (degenerate).
|
|
TVector3< T > | safeGetFaceNormal (const TVector3< T > &failSafe={0, 1, 0}) const |
| Calculate face normal with a fail-safe value. The vertices may form a degenerate triangle (zero cross product and thus producing NaNs after being normalized, or vertices with Inf/NaN), in such case the fail-safe vector will be returned.
|
|
std::pair< TVector3< T >, TVector3< T > > | getEdgeVectors () const |
|
TVector3< T > | surfaceToBarycentric (const TVector3< T > &position) const |
|
TVector3< T > | barycentricToSurface (const TVector3< T > &barycentricCoords) const |
|
TVector3< T > | sampleToBarycentricOsada (const std::array< T, 2 > &sample) const |
| Map the 2D sample to a position on the surface of the triangle. A common mapping on triangles which is based on slicing the triangular area into stripes. The mapped positions (after being converted from barycentric coordinates) are distributed uniformly if the sample is uniform. Reference: Osada et al., Section 4.2, "Shape Distributions", TOG02.
|
|
TVector3< T > | sampleToBarycentricOsada (const std::array< T, 2 > &sample, T *out_pdfA) const |
|
T | uniformSurfaceSamplePdfA () const |
|
bool | isDegenerate () const |
|
TVector3< T > | getVa () const |
|
TVector3< T > | getVb () const |
|
TVector3< T > | getVc () const |
|
|
static TVector3< T > | interpolate (const std::array< TVector3< T >, 3 > &attributes, const TVector3< T > &barycentricCoords) |
|
static TVector3< T > | interpolate (const TVector3< T > &attributeA, const TVector3< T > &attributeB, const TVector3< T > &attributeC, const TVector3< T > &barycentricCoords) |
|
static bool | calcSurfaceParamDerivatives (const std::array< TVector3< T >, 3 > &attributes, const std::array< TVector2< T >, 3 > ¶meterizations, TVector3< T > *out_dXdU, TVector3< T > *out_dXdV) |
|
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TBasicTriangle) |
|
◆ isIntersecting()
Checks whether the segment
is interseting with this triangle.
- Parameters
-
| segment | The line section to intersect with. |
[out] | out_hitT | The parametric distance of the hit point for segment . |
[out] | out_hitBarycentricCoords | The barycentric coordinates of the hit point for this triangle. |
- Note
- It is advisible to use
out_hitBarycentricCoodrs
to calculate the hit point as the numerical error will generally be smaller than using out_hitT
.
The documentation for this class was generated from the following files: