Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/FSegmentTree3
Description
Find the segment that is hit by a 3D ray under a function WithinToleranceCheck, which will be called with the Ray and Segment points. For example if this is a 3D distance check against a fixed radius, this function essentially raycasts against 3D capsules.
The function compares potential hits (ie that pass the tolerance) with a sort of "distance" metric that tries to balance distance from the ray origin (ie "close to eye") and distance from the hit segment (ie "on the line"). There is no correct way to do this, currently the code uses a metric based on the opening angle between ray and segment points.
| Name | FindNearestVisibleSegmentHitByRay |
| Type | function |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Spatial/SegmentTree3.h |
| Include Path | #include "Spatial/SegmentTree3.h" |
bool FindNearestVisibleSegmentHitByRay
(
const FRay3d & Ray,
TFunctionRef < bool> WithinToleranceCheck,
FSegment & NearestHitSegmentOut,
FRayNearestSegmentInfo & NearestInfo,
const IMeshSpatial::FQueryOptions & Options
) const