FMath::SegmentIntersection2D

Returns true if there is an intersection between the segment specified by SegmentStartA and SegmentEndA, and the segment specified by SegmentStartB and SegmentEndB, in 2D space.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h

Include

#include "Math/UnrealMathUtility.h"

Source

/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp

Syntax

static bool SegmentIntersection2D
(
    const FVector & SegmentStartA,
    const FVector & SegmentEndA,
    const FVector & SegmentStartB,
    const FVector & SegmentEndB,
    FVector & out_IntersectionPoint
)

Remarks

Returns true if there is an intersection between the segment specified by SegmentStartA and SegmentEndA, and the segment specified by SegmentStartB and SegmentEndB, in 2D space. If there is an intersection, the point is placed in out_IntersectionPoint

Returns

true if intersection occurred

Parameters

Parameter

Description

SegmentStartA

start point of first segment

SegmentEndA

end point of first segment

SegmentStartB

start point of second segment

SegmentEndB

end point of second segment

out_IntersectionPoint

out var for the intersection point (if any)

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