TSegment2

2D Line Segment stored as Center point, normalized Direction vector, and scalar Extent

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/SegmentTypes.h

Include

#include "SegmentTypes.h"

Syntax

template<typename T>
struct TSegment2

Remarks

2D Line Segment stored as Center point, normalized Direction vector, and scalar Extent

Variables

Name Description

Public variable

FVector2< T >

 

Center

Center point of segment

Public variable

FVector2< T >

 

Direction

Normalized Direction vector of segment

Public variable

T

 

Extent

Extent of segment, which is half the total length

Constructors

Name Description

Public function

TSegment2()

Public function

TSegment2

(
    const FVector2< T >& Point0,
    const FVector2< T >& Point1
)

Construct a Segment from two Points

Public function

TSegment2

(
    const FVector2< T >& CenterIn,
    const FVector2< T >& DirectionIn,
    T ExtentIn
)

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

Functions

Name Description

Public function Const

T

 

DistanceSquared

(
    const FVector2< T >& Point,
    T& DistParameterOut
)

Public function Const

T

 

DistanceSquared

(
    const FVector2< T >& Point
)

Public function Const

FVector2< T ...

 

EndPoint()

Public function Static

T

 

FastDistanceSquared

(
    const FVector2< T >& StartPt,
    const FVector2< T >& EndPt,
    const FVector2< T >& QueryPt,
    T Tolerance
)

Calculate distance from QueryPoint to segment (StartPt,EndPt)

Public function Const

FVector2< T ...

 

GetPointFromIndex

(
    int i
)

Public function Const

bool

 

Intersects

(
    const TSegment2< T >& OtherSegment,
    T DotThresh,
    T IntervalThresh
)

Test if this segment intersects with OtherSegment.

Public function Const

T

 

Length()

Public function Const

FVector2< T ...

 

NearestPoint

(
    const FVector2< T >& QueryPoint
)

Public function Const

FVector2< T ...

 

PointAt

(
    T DistanceParameter
)

Public function Const

FVector2< T ...

 

PointBetween

(
    T UnitParameter
)

Public function Const

T

 

Project

(
    const FVector2< T >& QueryPoint
)

Public function Const

T

 

ProjectUnitRange

(
    const FVector2< T >& QueryPoint
)

Public function

void

 

Reverse()

Reverse the segment

Public function

void

 

SetEndPoint

(
    const FVector2< T >& Point
)

Update the Segment with a new end point

Public function

void

 

SetStartPoint

(
    const FVector2< T >& Point
)

Update the Segment with a new start point

Public function Const

FVector2< T ...

 

StartPoint()

Protected function

void

 

update_from_endpoints

(
    const FVector2< T >& p0,
    const FVector2< T >& p1
)

Update segment based on new endpoints

Public function

int

 

WhichSide

(
    const FVector2< T >& QueryPoint,
    T Tolerance
)

Determine which side of the segment the query point lies on

Public function Static

int

 

WhichSide

(
    const FVector2< T >& StartPt,
    const FVector2< T >& EndPt,
    const FVector2< T >& QueryPt,
    T Tolerance
)

Determine which side of the segment the query point lies on

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss