FMath::GetDistanceWithinConeSegment

Calculates whether a Point is within a cone segment, and also what percentage within the cone (100% is along the center line, whereas 0% is along the edge)

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 GetDistanceWithinConeSegment
(
    FVector Point,
    FVector ConeStartPoint,
    FVector ConeLine,
    float RadiusAtStart,
    float RadiusAtEnd,
    float & PercentageOut
)

Remarks

Calculates whether a Point is within a cone segment, and also what percentage within the cone (100% is along the center line, whereas 0% is along the edge)

Returns

true if the point is within the cone, false otherwise.

Parameters

Parameter

Description

Point

The Point in question

ConeStartPoint

the beginning of the cone (with the smallest radius)

ConeLine

the line out from the start point that ends at the largest radius point of the cone

radiusAtStart

the radius at the ConeStartPoint (0 for a 'proper' cone)

radiusAtEnd

the largest radius of the cone

percentageOut

output variable the holds how much within the cone the point is (1 = on center line, 0 = on exact edge or outside cone).

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