Navigation
API > API/Runtime > API/Runtime/GeometryCore
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/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
| Type | Name | Description | |
|---|---|---|---|
| TVector2< T > | Center | Center point of segment | |
| TVector2< T > | Direction | Normalized Direction vector of segment | |
| T | Extent | Extent of segment, which is half the total length |
Constructors
| Type | Name | Description | |
|---|---|---|---|
TSegment2 () |
|||
| Construct a Segment from two Points | |||
| Construct a segment from a Center Point, normalized Direction, and scalar Extent |
Functions
| Type | Name | Description | |
|---|---|---|---|
| T | DistanceSquared
(
const TVector2< T >& Point, |
||
| T | DistanceSquared
(
const TVector2< T >& Point |
||
| TVector2< T > | EndPoint () |
||
| T | FastDistanceSquared
(
const TVector2< T >& StartPt, |
Calculate distance from QueryPoint to segment (StartPt,EndPt) | |
| TVector2< T > | GetPointFromIndex
(
int i |
||
| bool | Intersects
(
const TSegment2< T >& OtherSegment, |
Test if this segment intersects with OtherSegment. | |
| T | Length () |
||
| TVector2< T > | NearestPoint
(
const TVector2< T >& QueryPoint |
||
| TVector2< T > | PointAt
(
T DistanceParameter |
||
| TVector2< T > | PointBetween
(
T UnitParameter |
||
| T | |||
| T | ProjectUnitRange
(
const TVector2< T >& QueryPoint |
||
| void | Reverse () |
Reverse the segment | |
| void | SetEndPoint
(
const TVector2< T >& Point |
Update the Segment with a new end point | |
| void | SetStartPoint
(
const TVector2< T >& Point |
Update the Segment with a new start point | |
| TVector2< T > | StartPoint () |
||
| void | update_from_endpoints
(
const TVector2< T >& p0, |
Update segment based on new endpoints | |
| int | Determine which side of the segment the query point lies on | ||
| int | Determine which side of the segment the query point lies on |