#GetActorEyesViewPoint doesn't really "

1 messages · Page 1 of 1 (latest)

spare parcel
#

Maybe I am misunderstanding. Let's go through it together.

In AIPerceptionSystem tick it is calling

// first update cached location of all listener, and remove invalid listeners for (AIPerception::FListenerMap::TIterator ListenerIt(ListenerContainer); ListenerIt; ++ListenerIt) { if (ListenerIt->Value.Listener.IsValid()) { ListenerIt->Value.CacheLocation(); } else { OnListenerRemoved(ListenerIt->Value); ListenerIt.RemoveCurrent(); } }

which is

void FPerceptionListener::CacheLocation() { if (Listener.IsValid()) { Listener->GetLocationAndDirection(CachedLocation, CachedDirection); } }

leads to

void UAIPerceptionComponent::GetLocationAndDirection(FVector& Location, FVector& Direction) const { const AActor* OwnerActor = Cast<AActor>(GetOuter()); if (OwnerActor != nullptr) { FRotator ViewRotation(ForceInitToZero); OwnerActor->GetActorEyesViewPoint(Location, ViewRotation); Direction = ViewRotation.Vector(); } }

and thus it gets pawn's rotation and to upate sight's rotation if I understand it correctly. No?