UCameraComponent 를 상속받은 Component 에서 Tick 마다 업데이트될 정보가 있어서 TickComponent 를 상속받아서 구현했더니 TickComponent 가 호출되지 않네. UCameraComponent 소스를 확인해보니 AActor::CalcCamera 에서 UCameraComponent::GetCameraView 를 호출하고 있으니 GetCameraView 상속받아서 구현하니 돌아감.
void AActor::CalcCamera(float DeltaTime, FMinimalViewInfo& OutResult)
{
if (bFindCameraComponentWhenViewTarget)
{
// Look for the first active camera component and use that for the view
TArray<UCameraComponent*> Cameras;
GetComponents<UCameraComponent>(/*out*/ Cameras);
for (UCameraComponent* CameraComponent : Cameras)
{
if (CameraComponent->bIsActive)
{
CameraComponent->GetCameraView(DeltaTime, OutResult);
return;
}
}
}
GetActorEyesViewPoint(OutResult.Location, OutResult.Rotation);
}
UCLASS(HideCategories=(Mobility, Rendering, LOD), ClassGroup=Camera, meta=(BlueprintSpawnableComponent), MinimalAPI)
class UCameraComponent : public USceneComponent
{
...
/**
* Returns camera's Point of View.
* Called by Camera class. Subclass and postprocess to add any effects.
*/
UFUNCTION(BlueprintCallable, Category=Camera)
ENGINE_API virtual void GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView);
...
}