diff --git a/Source/ALSV4_CPP/Private/AI/ALSAIController.cpp b/Source/ALSV4_CPP/Private/AI/ALSAIController.cpp index 1c416b8a..73ea84ff 100644 --- a/Source/ALSV4_CPP/Private/AI/ALSAIController.cpp +++ b/Source/ALSV4_CPP/Private/AI/ALSAIController.cpp @@ -7,6 +7,8 @@ #include "AI/ALSAIController.h" +#include "Character/ALSBaseCharacter.h" + AALSAIController::AALSAIController() { } @@ -20,3 +22,18 @@ void AALSAIController::OnPossess(APawn* InPawn) RunBehaviorTree(Behaviour); } } + +FVector AALSAIController::GetFocalPointOnActor(const AActor* Actor) const +{ + if (Actor == nullptr) + { + return FAISystem::InvalidLocation; + } + const APawn* FocusPawn = Cast(Actor); + if (FocusPawn) + { + // Focus on pawn's eye view point + return FocusPawn->GetPawnViewLocation(); + } + return Actor->GetActorLocation(); +} diff --git a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp index 29000b75..737a22a9 100644 --- a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp +++ b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp @@ -14,7 +14,6 @@ #include "Library/ALSMathLibrary.h" #include "Components/CapsuleComponent.h" #include "Components/TimelineComponent.h" -#include "Curves/CurveVector.h" #include "Curves/CurveFloat.h" #include "Character/ALSCharacterMovementComponent.h" #include "GameFramework/CharacterMovementComponent.h" diff --git a/Source/ALSV4_CPP/Public/AI/ALSAIController.h b/Source/ALSV4_CPP/Public/AI/ALSAIController.h index c08281ec..29dfcfc0 100644 --- a/Source/ALSV4_CPP/Public/AI/ALSAIController.h +++ b/Source/ALSV4_CPP/Public/AI/ALSAIController.h @@ -29,4 +29,6 @@ class ALSV4_CPP_API AALSAIController : public AAIController protected: virtual void OnPossess(APawn* InPawn) override; + + virtual FVector GetFocalPointOnActor(const AActor *Actor) const override; };