Hi all. I am a bit confused with all the stuff around Pawn and Camera control inside the API. Here is what I have:
I have created A new Pawn class that extends UE4 APawn. I am writing a camera controlling logic which is a bit different from what the DefaultPawn class allows. So for example I have implemented Arcball control. And here is where my confusion:
For example I don’t really understand spacial relationship between APawn , APlayerController and APlayerCameraManager. In my code where I create rotation matrix to apply rotation from the Arcball to the scene Actor I need to access camera’s FTransform or at least of some object that holds control of camera’s transformation.
I see I can do it like this:
const FTransform viewMatr = GetActorTransform();
Or like this:
const FTransform viewMatr = GetWorld()->GetFirstPlayerController()->PlayerCameraManager->GetTransform();
Maybe there are more ways to do that… So getActorTransform() is the transform of the parent actor to which camera component is attached to,right? That means that camera has the same transform? Then what kind of transform is PlayerCameraManager->GetTransform()? From what I see ,using any of these two makes no difference how my arcball controller works. Btw, I found no docs which explain how to retrieve actual camera matrices like its view matrix (inverse model) ,or projection matrix.
So I am asking someone to explain,maybe even schematically, how UCameraComponent, APlayerController,PlayerCameraManager related to each other,both functionally and in spacial hierarchy.
It is also not clear to me these variables:
bUseControllerRotationPitch = true; bUseControllerRotationYaw = true; bUseControllerRotationRoll = false;
In my code I perform rotation using action binding for mouse X , Y movement ,then calling
But, if I set
bUseControllerRotationPitch = false; bUseControllerRotationYaw = false;
The rotation is not propagated,which means the rotation impacts the controller.Then what it impacts if the above flags are false? The APawn?
Appreciate constructive answer,and I am sure I am not the only one having these questions.