There are a couple of definitions we have to understand first, to comprehend what is happening here.
1- DefaultObject- Each class has an instance of a DefaultObject, that basically has all the data values of a newly constructed object. It allows you to do a lot of neat things, like for example getting the default values of variables, etc.
2- Subobjects- Each object can have Subobjects on them, most of the times they are things like components. An example here is the Meshes under the characters
3- DefaultSubobjects- This are Subobjects that any new instance of the ParentObject will have, as in not added dynamically (through gameplay) but added in the constructor of the class (
Mesh1P = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT(“PawnMesh1P”)); ) So the line that does
USkeletalMeshComponent* DefMesh1P = Cast<USkeletalMeshComponent>(GetClass()->GetDefaultSubobjectByName(TEXT(“PawnMesh1P”)));
Is getting the PawnMesh1P of the default object. It basically is getting the default values of that mesh as it uses them to rotate the Mesh1P of the running instance, as you can see later in the OnCameraUpdate function Mesh1P->SetRelativeLocationAndRotation(PitchedMesh.GetOrigin(), PitchedMesh.Rotator());
Hope that helps