Navigation
API > API/Runtime > API/Runtime/GeometryCore
2D Line Segment stored as Center point, normalized Direction vector, and scalar Extent
| Name | TSegment2 |
| Type | struct |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/SegmentTypes.h |
| Include Path | #include "SegmentTypes.h" |
| Source | /Engine/Source/Runtime/GeometryCore/Public/Intersection/IntersectionQueries2.h |
Syntax
template<typename T>
struct TSegment2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSegment2 () |
SegmentTypes.h | ||
| Construct a Segment from two Points | SegmentTypes.h | ||
| Construct a segment from a Center Point, normalized Direction, and scalar Extent | SegmentTypes.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Center | TVector2< T > | Center point of segment | SegmentTypes.h | |
| Direction | TVector2< T > | Normalized Direction vector of segment | SegmentTypes.h | |
| Extent | T | Extent of segment, which is half the total length | SegmentTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T ConvertToUnitRange
(
T DistanceParameter |
SegmentTypes.h | ||
T DistanceSquared
(
const TVector2< T >& Point, |
SegmentTypes.h | ||
T DistanceSquared
(
const TVector2< T >& Point |
SegmentTypes.h | ||
TVector2< T > EndPoint() |
SegmentTypes.h | ||
TVector2< T > GetPointFromIndex
(
int i |
SegmentTypes.h | ||
| Determine which side of the segment the query point lies on. | SegmentTypes.h | ||
bool Intersects
(
const TSegment2< T >& OtherSegment, |
Test if this segment intersects with OtherSegment. | SegmentTypes.h | |
T Length() |
SegmentTypes.h | ||
| SegmentTypes.h | |||
TVector2< T > PointAt
(
T DistanceParameter |
SegmentTypes.h | ||
TVector2< T > PointBetween
(
T UnitParameter |
SegmentTypes.h | ||
T Project
(
const TVector2< T >& QueryPoint |
SegmentTypes.h | ||
T ProjectUnitRange
(
const TVector2< T >& QueryPoint |
SegmentTypes.h | ||
void Reverse() |
Reverse the segment | SegmentTypes.h | |
void SetEndPoint
(
const TVector2< T >& Point |
Update the Segment with a new end point | SegmentTypes.h | |
void SetStartPoint
(
const TVector2< T >& Point |
Update the Segment with a new start point | SegmentTypes.h | |
TVector2< T > StartPoint() |
SegmentTypes.h | ||
| Determine which side of the segment the query point lies on. | SegmentTypes.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Update segment based on new endpoints | SegmentTypes.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Calculate distance from QueryPoint to segment (StartPt,EndPt) | SegmentTypes.h | ||
| Determine which side of the segment the query point lies on. | SegmentTypes.h | ||
| Return true if QueryPt is on the segment between A and B. | SegmentTypes.h | ||
| Determine which side of the segment the query point lies on. | SegmentTypes.h |