UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAISightQuery Struct Reference

#include <AISense_Sight.h>

Classes

class  FSortPredicate
 

Public Member Functions

 FAISightQuery (FPerceptionListenerID ListenerId=FPerceptionListenerID::InvalidID(), FAISightTarget::FTargetId Target=FAISightTarget::InvalidTargetId)
 
float GetAge () const
 
void RecalcScore ()
 
void OnProcessed ()
 
void ForgetPreviousResult ()
 
bool GetLastResult () const
 
void SetLastResult (const bool bValue)
 
void SetTraceInfo (const FTraceHandle &TraceHandle)
 

Public Attributes

FPerceptionListenerID ObserverId
 
FAISightTarget::FTargetId TargetId
 
float Score
 
float Importance
 
FVector LastSeenLocation
 
int32 UserData
 
union { 
 
   struct { 
 
      uint64   bLastResult:1 
 
      uint64   LastProcessedFrameNumber:63 
 
   }   FrameInfo 
 
   struct { 
 
      uint32   bLastResult:1 
 
      uint32   Index:31 
 
      uint32   FrameNumber 
 
   }   TraceInfo 
 
};  
 

Constructor & Destructor Documentation

◆ FAISightQuery()

FAISightQuery::FAISightQuery ( FPerceptionListenerID  ListenerId = FPerceptionListenerID::InvalidID(),
FAISightTarget::FTargetId  Target = FAISightTarget::InvalidTargetId 
)
inline

Member Function Documentation

◆ ForgetPreviousResult()

void FAISightQuery::ForgetPreviousResult ( )
inline

◆ GetAge()

float FAISightQuery::GetAge ( ) const
inline

Note: This should only be called on queries that are queued up for later processing (in SightQueriesOutOfRange or SightQueriesOutOfRange)

◆ GetLastResult()

bool FAISightQuery::GetLastResult ( ) const
inline

◆ OnProcessed()

void FAISightQuery::OnProcessed ( )
inline

◆ RecalcScore()

void FAISightQuery::RecalcScore ( )
inline

Note: This should only be called on queries that are queued up for later processing (in SightQueriesOutOfRange or SightQueriesOutOfRange)

◆ SetLastResult()

void FAISightQuery::SetLastResult ( const bool  bValue)
inline

◆ SetTraceInfo()

void FAISightQuery::SetTraceInfo ( const FTraceHandle TraceHandle)
inline

Note: This only be called for pending queries because it will erase the LastProcessedFrameNumber value

Member Data Documentation

◆ [union]

union { ... } FAISightQuery

◆ bLastResult [1/2]

uint64 FAISightQuery::bLastResult

◆ bLastResult [2/2]

uint32 FAISightQuery::bLastResult

◆ [struct]

struct { ... } FAISightQuery::FrameInfo

We can share the memory for these values because they aren't used at the same time :

  • The FrameInfo is used when the query is queued for an update at a later frame. It stores the last time the query was processed so that we can prioritize it accordingly against the other queries
  • The TraceInfo is used when the query has requested a asynchronous trace and is waiting for the result. The engine guarantees that we'll get the info at the next frame, but since we can have multiple queries that are pending at the same time, we need to store some information to identify them when receiving the result callback

◆ FrameNumber

uint32 FAISightQuery::FrameNumber

◆ Importance

float FAISightQuery::Importance

◆ Index

uint32 FAISightQuery::Index

◆ LastProcessedFrameNumber

uint64 FAISightQuery::LastProcessedFrameNumber

◆ LastSeenLocation

FVector FAISightQuery::LastSeenLocation

◆ ObserverId

FPerceptionListenerID FAISightQuery::ObserverId

◆ Score

float FAISightQuery::Score

◆ TargetId

FAISightTarget::FTargetId FAISightQuery::TargetId

◆ [struct]

struct { ... } FAISightQuery::TraceInfo

The 'FrameNumber' value can increase indefinitely while the 'Index' represents the number of queries that were already requested during this frame. So it shouldn't reach high values in the allocated 32 bits. Thanks to that we can reliable only use 31 bits for this value and thus have space to keep the bLastResult value

◆ UserData

int32 FAISightQuery::UserData
mutable

User data that can be used inside the IAISightTargetInterface::CanBeSeenFrom method to store a persistence state


The documentation for this struct was generated from the following file: