Space Plunder
Loading...
Searching...
No Matches
FAimAssistHit Class Reference

Represents an aim assist hit. More...

#include <InteractionData.h>

Public Member Functions

void AddHits (const float Value, const float MaxValue)
 
void AddHits (const float Value)
 
FVector GetInteractionLocation () const
 
FVector GetDirectionToTarget (const FVector &Location) const
 
bool operator== (const FAimAssistHit &Other) const
 
bool IsValid () const
 

Public Attributes

FHitResult HitResult
 
float Hits = 0
 
AActor * Target = nullptr
 
class IInteractionInterfaceTargetInteraction = nullptr
 

Detailed Description

Represents an aim assist hit.

The FAimAssistHit struct contains information about an aim assist hit, including the hit result, number of hits, target actor, target interaction interface, and various utility functions.

Member Function Documentation

◆ AddHits() [1/2]

void FAimAssistHit::AddHits ( const float Value)
inline

If just Removing Hits

215 {
216 Hits += Value;
217 if(Hits <= 0)
218 {
219 Hits = 0;
220 }
221 }
float Hits
Definition InteractionData.h:194

◆ AddHits() [2/2]

void FAimAssistHit::AddHits ( const float Value,
const float MaxValue )
inline

If Adding or removing Hits, will check Min + Max

202 {
203 Hits += Value;
204 if(Hits >= MaxValue)
205 {
206 Hits = MaxValue;
207 }
208 if(Hits <= 0)
209 {
210 Hits = 0;
211 }
212 }

◆ GetDirectionToTarget()

FVector FAimAssistHit::GetDirectionToTarget ( const FVector & Location) const
inline
238 {
239 return (GetInteractionLocation() - Location).GetSafeNormal();
240 }
FVector GetInteractionLocation() const
Definition InteractionData.h:223

◆ GetInteractionLocation()

FVector FAimAssistHit::GetInteractionLocation ( ) const
inline
224 {
225 if(TargetInteraction == nullptr)
226 {
227 UE_LOG(LogAimData, Error, TEXT("Invalid Interaction Interface on FAimAssistHit Struct"));
228 if(Target != nullptr)
229 {
230 return Target->GetActorLocation();
231 }
232 return FVector::ZeroVector;
233 }
235 }
virtual FVector GetInteractionLocation() const =0
AActor * Target
Definition InteractionData.h:196
class IInteractionInterface * TargetInteraction
Definition InteractionData.h:198

◆ IsValid()

bool FAimAssistHit::IsValid ( ) const
inline
252 {
253 return Target != nullptr;
254 }

◆ operator==()

bool FAimAssistHit::operator== ( const FAimAssistHit & Other) const
inline
243 {
244 bool bEqual = true;
245 if(Target != Other.Target)
246 {
247 bEqual = false;
248 }
249 return bEqual;
250 }

Member Data Documentation

◆ HitResult

FHitResult FAimAssistHit::HitResult

◆ Hits

float FAimAssistHit::Hits = 0

◆ Target

AActor* FAimAssistHit::Target = nullptr

◆ TargetInteraction

class IInteractionInterface* FAimAssistHit::TargetInteraction = nullptr

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