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

#include <LineTypes.h>

Public Member Functions

 TLine2 ()
 
 TLine2 (const TVector2< T > &OriginIn, const TVector2< T > &DirectionIn)
 
TVector2< T > PointAt (T LineParameter) const
 
Project (const TVector2< T > &QueryPoint) const
 
DistanceSquared (const TVector2< T > &QueryPoint) const
 
TVector2< T > NearestPoint (const TVector2< T > &QueryPoint) const
 
int WhichSide (const TVector2< T > &QueryPoint, T OnLineTolerance=0) const
 
bool IntersectionPoint (const TLine2< T > &OtherLine, TVector2< T > &IntersectionPointOut, T ParallelDotTolerance=TMathUtil< T >::ZeroTolerance) const
 

Static Public Member Functions

static TLine2< T > FromPoints (const TVector2< T > &Point0, const TVector2< T > &Point1)
 

Public Attributes

TVector2< T > Origin
 
TVector2< T > Direction
 

Detailed Description

template<typename T>
struct UE::Geometry::TLine2< T >

TLine2 is a two-dimensional infinite line. The line is stored in (Center,Direction) form.

Constructor & Destructor Documentation

◆ TLine2() [1/2]

template<typename T >
UE::Geometry::TLine2< T >::TLine2 ( )
inline

Construct default line along X axis

◆ TLine2() [2/2]

template<typename T >
UE::Geometry::TLine2< T >::TLine2 ( const TVector2< T > &  OriginIn,
const TVector2< T > &  DirectionIn 
)
inline

Construct line with given Origin and Direction

Member Function Documentation

◆ DistanceSquared()

template<typename T >
T UE::Geometry::TLine2< T >::DistanceSquared ( const TVector2< T > &  QueryPoint) const
inline
Returns
smallest squared distance from line to QueryPoint

◆ FromPoints()

template<typename T >
static TLine2< T > UE::Geometry::TLine2< T >::FromPoints ( const TVector2< T > &  Point0,
const TVector2< T > &  Point1 
)
inlinestatic
Returns
line between two points

◆ IntersectionPoint()

template<typename T >
bool UE::Geometry::TLine2< T >::IntersectionPoint ( const TLine2< T > &  OtherLine,
TVector2< T > &  IntersectionPointOut,
ParallelDotTolerance = TMathUtil<T>::ZeroTolerance 
) const
inline

Calculate intersection point between this line and another one

Parameters
OtherLineline to test against
IntersectionPointOutintersection point is stored here, if found
ParallelDotTolerancetolerance used to determine if lines are parallel (and hence cannot intersect)
Returns
true if lines intersect and IntersectionPointOut was computed

◆ NearestPoint()

template<typename T >
TVector2< T > UE::Geometry::TLine2< T >::NearestPoint ( const TVector2< T > &  QueryPoint) const
inline
Returns
nearest point on line to QueryPoint

◆ PointAt()

template<typename T >
TVector2< T > UE::Geometry::TLine2< T >::PointAt ( LineParameter) const
inline
Returns
point on line at given line parameter value (distance along line from origin)

◆ Project()

template<typename T >
T UE::Geometry::TLine2< T >::Project ( const TVector2< T > &  QueryPoint) const
inline
Returns
line parameter (ie distance from Origin) at nearest point on line to QueryPoint

◆ WhichSide()

template<typename T >
int UE::Geometry::TLine2< T >::WhichSide ( const TVector2< T > &  QueryPoint,
OnLineTolerance = 0 
) const
inline
Returns
+1 if QueryPoint is "right" of line, -1 if "left" or 0 if "on" line (up to given tolerance)

Member Data Documentation

◆ Direction

template<typename T >
TVector2<T> UE::Geometry::TLine2< T >::Direction

Direction of Line, Normalized

◆ Origin

template<typename T >
TVector2<T> UE::Geometry::TLine2< T >::Origin

Origin / Center Point of Line


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