UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AIHelpers.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "AITypes.h"
6#include "Containers/Array.h"
7#include "Math/MathFwd.h"
8#include "Math/Quat.h"
9#include "Math/Rotator.h"
10#include "Misc/Optional.h"
12
13class AActor;
14class UActorComponent;
15
16namespace FAISystem
17{
18 AIMODULE_API FVector FindClosestLocation(const FVector& Origin, const TArray<FVector>& Locations);
19
20 //----------------------------------------------------------------------//
21 // CheckIsTargetInSightCone
22 // F
23 // *****
24 // * *
25 // * *
26 // * *
27 // * *
28 // * *
29 // \ /
30 // \ /
31 // \ /
32 // \ X /
33 // \ /
34 // \ *** /
35 // \ * N * /
36 // \ * * /
37 // N N
38 //
39 //
40 //
41 //
42 //
43 //
44 // B
45 //
46 // X = StartLocation
47 // B = Backward offset
48 // N = Near Clipping Radius (from the StartLocation adjusted by Backward offset)
49 // F = Far Clipping Radius (from the StartLocation adjusted by Backward offset)
50 //----------------------------------------------------------------------//
51 AIMODULE_API bool CheckIsTargetInSightCone(const FVector& StartLocation, const FVector& ConeDirectionNormal, float PeripheralVisionAngleCos,
52 float ConeDirectionBackwardOffset, float NearClippingRadiusSq, float const FarClippingRadiusSq, const FVector& TargetLocation);
53}
54
55namespace UE::AI
56{
61 UE_DEPRECATED(5.2, "Deprecated as returning float instead of FVector::FReal. Use FVector::ToOrientationRotator()::Yaw etc.")
63
68 UE_DEPRECATED(5.2, "Deprecated as returning float instead of FVector::FReal. Use FRotator::Yaw etc.")
70
75 UE_DEPRECATED(5.2, "Deprecated as returning float instead of FVector::FReal. Use FQuat::Rotator()::Yaw etc.")
77
78 UE_DEPRECATED(5.3, "Please use UE::BlueprintTools::GetActorClassDefaultComponents() instead")
80} // UE::AI
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Actor.h:257
Definition UnrealType.h:3087
Definition Array.h:670
Definition SubclassOf.h:30
Definition ActorComponent.h:152
Definition AIController.h:459
FVector FindClosestLocation(const FVector &Origin, const TArray< FVector > &Locations)
Definition AIHelpers.cpp:8
bool CheckIsTargetInSightCone(const FVector &StartLocation, const FVector &ConeDirectionNormal, float PeripheralVisionAngleCos, float ConeDirectionBackwardOffset, float NearClippingRadiusSq, float const FarClippingRadiusSq, const FVector &TargetLocation)
Definition AIHelpers.cpp:57
Definition AIHelpers.cpp:82
TOptional< float > GetYawFromRotator(const FRotator &Rotator)
Definition AIHelpers.cpp:103
void GetActorClassDefaultComponents(const TSubclassOf< AActor > &ActorClass, TArray< UActorComponent * > &OutComponents, const TSubclassOf< UActorComponent > &InComponentClass)
Definition AIHelpers.cpp:117
TOptional< float > GetYawFromVector(const FVector &Vector)
Definition AIHelpers.cpp:84
TOptional< float > GetYawFromQuaternion(const FQuat &Quaternion)
Definition AIHelpers.cpp:110
Definition AdvancedWidgetsModule.cpp:13
Definition Optional.h:131