#include <SegmentTypes.h>
|
| static T | FastDistanceSquared (const TVector2< T > &StartPt, const TVector2< T > &EndPt, const TVector2< T > &QueryPt, T Tolerance=TMathUtil< T >::Epsilon) |
| |
| static int | GetSide (const TVector2< T > &StartPt, const TVector2< T > &EndPt, const TVector2< T > &QueryPt, T Tolerance=(T) 0) |
| |
| static int | WhichSide (const TVector2< T > &StartPt, const TVector2< T > &EndPt, const TVector2< T > &QueryPt, T Tolerance=(T) 0) |
| |
| static bool | IsOnSegment (const TVector2< T > &A, const TVector2< T > &B, const TVector2< T > &QueryPt, T Tolerance=(T) 0) |
| |
◆ TSegment2() [1/3]
◆ TSegment2() [2/3]
Construct a Segment from two Points
◆ TSegment2() [3/3]
Construct a segment from a Center Point, normalized Direction, and scalar Extent
◆ ConvertToUnitRange()
- Parameters
-
| DistanceParameter | distance on the segment from the segment Origin in range [-Extent, Extent] |
- Returns
- unit value in range [0,1]
◆ DistanceSquared() [1/2]
- Returns
- minimum squared distance from Point to segment
◆ DistanceSquared() [2/2]
- Parameters
-
| Point | query point |
| DistParameterOut | calculated distance parameter in range [-Extent,Extent] |
- Returns
- minimum squared distance from Point to Segment
◆ EndPoint()
- Returns
- end point of segment
◆ FastDistanceSquared()
Calculate distance from QueryPoint to segment (StartPt,EndPt)
◆ GetPointFromIndex()
- Returns
- first (i == 0) or second (i == 1) endpoint of the Segment
◆ GetSide() [1/2]
Determine which side of the segment the query point lies on.
- Parameters
-
| QueryPoint | test point |
| Tolerance | tolerance band in which we return 0 |
- Returns
- -1 if point is to right of line, +1 if left, and 0 if on line or within tolerance band
◆ GetSide() [2/2]
Determine which side of the segment the query point lies on.
- Parameters
-
| StartPt | first point of Segment |
| EndPt | second point of Segment |
| QueryPoint | test point |
| Tolerance | tolerance band in which we return 0. Note that using tolerance == 0 is faster because we do not need to get distance of point from segment line. |
- Returns
- -1 if point is to right of line, +1 if left, and 0 if on line or within tolerance band, or segment was degenerate
◆ Intersects()
Test if this segment intersects with OtherSegment. Returns true for parallel-line overlaps. Returns same result as IntrSegment2Segment2
- Parameters
-
| OtherSegment | segment to test against |
| DotThresh | dot-product tolerance used to determine if segments are parallel |
| IntervalThresh | distance tolerance used to allow slighly-not-touching segments to be considered overlapping |
- Returns
- true if segments intersect
◆ IsOnSegment()
Return true if QueryPt is on the segment between A and B.
◆ Length()
- Returns
- the Length of the segment
◆ NearestPoint()
- Returns
- nearest point on segment to QueryPoint
◆ PointAt()
- Returns
- point on segment at given (signed) Distance from the segment Origin
◆ PointBetween()
- Parameters
-
| UnitParameter | value in range [0,1] |
- Returns
- point on segment at that linearly interpolates between start and end based on Unit Parameter
◆ Project()
- Returns
- scalar projection of QueryPoint onto line of Segment (not clamped to Extents)
◆ ProjectUnitRange()
- Returns
- scalar projection of QueryPoint onto line of Segment, mapped to [0,1] range along segment
◆ Reverse()
◆ SetEndPoint()
Update the Segment with a new end point
◆ SetStartPoint()
Update the Segment with a new start point
◆ StartPoint()
- Returns
- start point of segment
◆ update_from_endpoints()
◆ WhichSide() [1/2]
Determine which side of the segment the query point lies on. This version is deprecated because it and the static function give opposite results. It also does not correctly handle tolerance.
- Parameters
-
| QueryPoint | test point |
| Tolerance | tolerance band in which we return 0 |
- Returns
- -1 if point is to right of line, +1 if left, and 0 if on line or within tolerance band
◆ WhichSide() [2/2]
Determine which side of the segment the query point lies on. This version is deprecated because it and the member function give opposite results. It also does not correctly handle tolerance.
- Parameters
-
| StartPt | first point of Segment |
| EndPt | second point of Segment |
| QueryPoint | test point |
| Tolerance | tolerance band in which we return 0 |
- Returns
- +1 if point is to right of line, -1 if left, and 0 if on line or within tolerance band
◆ Center
◆ Direction
normalized Direction vector of segment
◆ Extent
Extent of segment, which is half the total length
The documentation for this struct was generated from the following files: