UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TTriangle2< RealType > Struct Template Reference

#include <TriangleTypes.h>

Public Member Functions

 TTriangle2 ()
 
 TTriangle2 (const TVector2< RealType > &V0, const TVector2< RealType > &V1, const TVector2< RealType > &V2)
 
 TTriangle2 (const TVector2< RealType > VIn[3])
 
TVector2< RealType > BarycentricPoint (RealType Bary0, RealType Bary1, RealType Bary2) const
 
TVector2< RealType > BarycentricPoint (const TVector< RealType > &BaryCoords) const
 
TVector< RealType > GetBarycentricCoords (const TVector2< RealType > &Point) const
 
RealType SignedArea () const
 
RealType Area () const
 
bool IsInside (const TVector2< RealType > &QueryPoint) const
 
bool IsInsideOrOn (const TVector2< RealType > &QueryPoint, RealType Tolerance=0) const
 
int IsInsideOrOn_Oriented (const TVector2< RealType > &QueryPoint, RealType Tolerance=(RealType) 0) const
 

Static Public Member Functions

static RealType SignedArea (const TVector2< RealType > &A, const TVector2< RealType > &B, const TVector2< RealType > &C)
 
static bool IsInside (const TVector2< RealType > &A, const TVector2< RealType > &B, const TVector2< RealType > &C, const TVector2< RealType > &QueryPoint)
 
static bool IsInsideOrOn (const TVector2< RealType > &A, const TVector2< RealType > &B, const TVector2< RealType > &C, const TVector2< RealType > &QueryPoint, RealType Tolerance=(RealType) 0)
 
static int IsInsideOrOn_Oriented (const TVector2< RealType > &A, const TVector2< RealType > &B, const TVector2< RealType > &C, const TVector2< RealType > &QueryPoint, RealType Tolerance=(RealType) 0)
 

Public Attributes

TVector2< RealType > V [3]
 

Constructor & Destructor Documentation

◆ TTriangle2() [1/3]

template<typename RealType >
UE::Geometry::TTriangle2< RealType >::TTriangle2 ( )
inline

◆ TTriangle2() [2/3]

template<typename RealType >
UE::Geometry::TTriangle2< RealType >::TTriangle2 ( const TVector2< RealType > &  V0,
const TVector2< RealType > &  V1,
const TVector2< RealType > &  V2 
)
inline

◆ TTriangle2() [3/3]

template<typename RealType >
UE::Geometry::TTriangle2< RealType >::TTriangle2 ( const TVector2< RealType >  VIn[3])
inline

Member Function Documentation

◆ Area()

template<typename RealType >
RealType UE::Geometry::TTriangle2< RealType >::Area ( ) const
inline
Returns
unsigned area of the triangle

◆ BarycentricPoint() [1/2]

template<typename RealType >
TVector2< RealType > UE::Geometry::TTriangle2< RealType >::BarycentricPoint ( const TVector< RealType > &  BaryCoords) const
inline

◆ BarycentricPoint() [2/2]

template<typename RealType >
TVector2< RealType > UE::Geometry::TTriangle2< RealType >::BarycentricPoint ( RealType  Bary0,
RealType  Bary1,
RealType  Bary2 
) const
inline

◆ GetBarycentricCoords()

template<typename RealType >
TVector< RealType > UE::Geometry::TTriangle2< RealType >::GetBarycentricCoords ( const TVector2< RealType > &  Point) const
inline

◆ IsInside() [1/2]

template<typename RealType >
static bool UE::Geometry::TTriangle2< RealType >::IsInside ( const TVector2< RealType > &  A,
const TVector2< RealType > &  B,
const TVector2< RealType > &  C,
const TVector2< RealType > &  QueryPoint 
)
inlinestatic
Parameters
Afirst vertex of triangle
Bsecond vertex of triangle
Cthird vertex of triangle
QueryPointtest point
Returns
true if QueryPoint is inside triangle

◆ IsInside() [2/2]

template<typename RealType >
bool UE::Geometry::TTriangle2< RealType >::IsInside ( const TVector2< RealType > &  QueryPoint) const
inline
Returns
true if QueryPoint is inside triangle

◆ IsInsideOrOn() [1/2]

template<typename RealType >
static bool UE::Geometry::TTriangle2< RealType >::IsInsideOrOn ( const TVector2< RealType > &  A,
const TVector2< RealType > &  B,
const TVector2< RealType > &  C,
const TVector2< RealType > &  QueryPoint,
RealType  Tolerance = (RealType)0 
)
inlinestatic
Returns
true if QueryPoint is inside triangle or on edge. Note that this is slower than IsInside because of the need to handle degeneracy and tolerance.

◆ IsInsideOrOn() [2/2]

template<typename RealType >
bool UE::Geometry::TTriangle2< RealType >::IsInsideOrOn ( const TVector2< RealType > &  QueryPoint,
RealType  Tolerance = 0 
) const
inline
Returns
true if QueryPoint is inside triangle or on edge. Note that this is slower than IsInside because of the need to handle degeneracy and tolerance.

◆ IsInsideOrOn_Oriented() [1/2]

template<typename RealType >
static int UE::Geometry::TTriangle2< RealType >::IsInsideOrOn_Oriented ( const TVector2< RealType > &  A,
const TVector2< RealType > &  B,
const TVector2< RealType > &  C,
const TVector2< RealType > &  QueryPoint,
RealType  Tolerance = (RealType)0 
)
inlinestatic

More robust (because it doesn't multiply orientation test results) inside-triangle test for oriented triangles only (the code early-outs at the first 'outside' edge, which only works if the triangle is oriented as expected)

Returns
1 if outside, -1 if inside, 0 if on boundary

◆ IsInsideOrOn_Oriented() [2/2]

template<typename RealType >
int UE::Geometry::TTriangle2< RealType >::IsInsideOrOn_Oriented ( const TVector2< RealType > &  QueryPoint,
RealType  Tolerance = (RealType)0 
) const
inline

More robust (because it doesn't multiply orientation test results) inside-triangle test for oriented triangles only (the code early-outs at the first 'outside' edge, which only works if the triangle is oriented as expected)

Returns
1 if outside, -1 if inside, 0 if on boundary

◆ SignedArea() [1/2]

template<typename RealType >
RealType UE::Geometry::TTriangle2< RealType >::SignedArea ( ) const
inline
Returns
signed area of triangle

◆ SignedArea() [2/2]

template<typename RealType >
static RealType UE::Geometry::TTriangle2< RealType >::SignedArea ( const TVector2< RealType > &  A,
const TVector2< RealType > &  B,
const TVector2< RealType > &  C 
)
inlinestatic
Parameters
Afirst vertex of triangle
Bsecond vertex of triangle
Cthird vertex of triangle
Returns
signed area of triangle

Member Data Documentation

◆ V

template<typename RealType >
TVector2<RealType> UE::Geometry::TTriangle2< RealType >::V[3]

The documentation for this struct was generated from the following file: