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

#include <SegmentTypes.h>

Public Member Functions

 TSegment3 ()=default
 
 TSegment3 (const TVector< T > &Point0, const TVector< T > &Point1)
 
 TSegment3 (const TVector< T > &CenterIn, const TVector< T > &DirectionIn, T ExtentIn)
 
void SetStartPoint (const TVector< T > &Point)
 
void SetEndPoint (const TVector< T > &Point)
 
void Reverse ()
 
TVector< T > StartPoint () const
 
TVector< T > EndPoint () const
 
Length () const
 
TVector< T > GetPointFromIndex (int i) const
 
TVector< T > PointAt (T DistanceParameter) const
 
TVector< T > PointBetween (T UnitParameter) const
 
ConvertToUnitRange (T DistanceParameter) const
 
DistanceSquared (const TVector< T > &Point) const
 
DistanceSquared (const TVector< T > &Point, T &DistParameterOut) const
 
TVector< T > NearestPoint (const TVector< T > &QueryPoint) const
 
Project (const TVector< T > &QueryPoint) const
 
ProjectUnitRange (const TVector< T > &QueryPoint) const
 
TAxisAlignedBox3< T > GetBounds () const
 
TAxisAlignedBox3< T > GetBounds (T SegmentRadius) const
 

Public Attributes

TVector< T > Center = TVector<T>::Zero()
 
TVector< T > Direction = TVector<T>::UnitX()
 
Extent = (T)0
 

Protected Member Functions

void update_from_endpoints (const TVector< T > &p0, const TVector< T > &p1)
 

Constructor & Destructor Documentation

◆ TSegment3() [1/3]

template<typename T >
UE::Geometry::TSegment3< T >::TSegment3 ( )
default

◆ TSegment3() [2/3]

template<typename T >
UE::Geometry::TSegment3< T >::TSegment3 ( const TVector< T > &  Point0,
const TVector< T > &  Point1 
)
inline

Construct a Segment from two Points

◆ TSegment3() [3/3]

template<typename T >
UE::Geometry::TSegment3< T >::TSegment3 ( const TVector< T > &  CenterIn,
const TVector< T > &  DirectionIn,
ExtentIn 
)
inline

Construct a segment from a Center Point, normalized Direction, and scalar Extent

Member Function Documentation

◆ ConvertToUnitRange()

template<typename T >
T UE::Geometry::TSegment3< T >::ConvertToUnitRange ( DistanceParameter) const
inline
Parameters
DistanceParameterdistance on the segment from the segment Origin in range [-Extent, Extent]
Returns
unit value in range [0,1]

◆ DistanceSquared() [1/2]

template<typename T >
T UE::Geometry::TSegment3< T >::DistanceSquared ( const TVector< T > &  Point) const
inline
Returns
minimum squared distance from Point to segment

◆ DistanceSquared() [2/2]

template<typename T >
T UE::Geometry::TSegment3< T >::DistanceSquared ( const TVector< T > &  Point,
T &  DistParameterOut 
) const
inline
Parameters
Pointquery point
DistParameterOutcalculated distance parameter in range [-Extent,Extent]
Returns
minimum squared distance from Point to Segment

◆ EndPoint()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::EndPoint ( ) const
inline
Returns
end point of segment

◆ GetBounds() [1/2]

template<typename T >
TAxisAlignedBox3< T > UE::Geometry::TSegment3< T >::GetBounds ( ) const
inline
Returns
axis-aligned bounding box of line segment

◆ GetBounds() [2/2]

template<typename T >
TAxisAlignedBox3< T > UE::Geometry::TSegment3< T >::GetBounds ( SegmentRadius) const
inline
Returns
axis-aligned bounding box of line segment thickened to given SegmentRadius

◆ GetPointFromIndex()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::GetPointFromIndex ( int  i) const
inline
Returns
first (i == 0) or second (i == 1) endpoint of the Segment

◆ Length()

template<typename T >
T UE::Geometry::TSegment3< T >::Length ( ) const
inline
Returns
the Length of the segment

◆ NearestPoint()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::NearestPoint ( const TVector< T > &  QueryPoint) const
inline
Returns
nearest point on segment to QueryPoint

◆ PointAt()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::PointAt ( DistanceParameter) const
inline
Returns
point on segment at given (signed) Distance from the segment Origin

◆ PointBetween()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::PointBetween ( UnitParameter) const
inline
Parameters
UnitParametervalue in range [0,1]
Returns
point on segment at that linearly interpolates between start and end based on Unit Parameter

◆ Project()

template<typename T >
T UE::Geometry::TSegment3< T >::Project ( const TVector< T > &  QueryPoint) const
inline
Returns
scalar projection of QueryPoint onto line of Segment (not clamped to Extents)

◆ ProjectUnitRange()

template<typename T >
T UE::Geometry::TSegment3< T >::ProjectUnitRange ( const TVector< T > &  QueryPoint) const
inline
Returns
scalar projection of QueryPoint onto line of Segment, mapped to [0,1] range along segment

◆ Reverse()

template<typename T >
void UE::Geometry::TSegment3< T >::Reverse ( )
inline

Reverse the segment

◆ SetEndPoint()

template<typename T >
void UE::Geometry::TSegment3< T >::SetEndPoint ( const TVector< T > &  Point)
inline

Update the Segment with a new end point

◆ SetStartPoint()

template<typename T >
void UE::Geometry::TSegment3< T >::SetStartPoint ( const TVector< T > &  Point)
inline

Update the Segment with a new start point

◆ StartPoint()

template<typename T >
TVector< T > UE::Geometry::TSegment3< T >::StartPoint ( ) const
inline
Returns
start point of segment

◆ update_from_endpoints()

template<typename T >
void UE::Geometry::TSegment3< T >::update_from_endpoints ( const TVector< T > &  p0,
const TVector< T > &  p1 
)
inlineprotected

Member Data Documentation

◆ Center

template<typename T >
TVector<T> UE::Geometry::TSegment3< T >::Center = TVector<T>::Zero()

Center point of segment

◆ Direction

template<typename T >
TVector<T> UE::Geometry::TSegment3< T >::Direction = TVector<T>::UnitX()

normalized Direction vector of segment

◆ Extent

template<typename T >
T UE::Geometry::TSegment3< T >::Extent = (T)0

Extent of segment, which is half the total length


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