本文整理汇总了C++中APawn::GetControlRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ APawn::GetControlRotation方法的具体用法?C++ APawn::GetControlRotation怎么用?C++ APawn::GetControlRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APawn
的用法示例。
在下文中一共展示了APawn::GetControlRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetActorRotation
FExecStatus FCameraCommandHandler::GetActorRotation(const TArray<FString>& Args)
{
APawn* Pawn = FUE4CVServer::Get().GetPawn();
FRotator CameraRotation = Pawn->GetControlRotation();
FString Message = FString::Printf(TEXT("%.3f %.3f %.3f"), CameraRotation.Pitch, CameraRotation.Yaw, CameraRotation.Roll);
return FExecStatus::OK(Message);
}
示例2: GetCameraRotation
FExecStatus FCameraCommandHandler::GetCameraRotation(const TArray<FString>& Args)
{
if (Args.Num() == 1)
{
bool bIsMatinee = false;
FRotator CameraRotation;
ACineCameraActor* CineCameraActor = nullptr;
for (AActor* Actor : this->GetWorld()->GetCurrentLevel()->Actors)
{
// if (Actor && Actor->IsA(AMatineeActor::StaticClass())) // AMatineeActor is deprecated
if (Actor && Actor->IsA(ACineCameraActor::StaticClass()))
{
bIsMatinee = true;
CameraRotation = Actor->GetActorRotation();
break;
}
}
if (!bIsMatinee)
{
int32 CameraId = FCString::Atoi(*Args[0]); // TODO: Add support for multiple cameras
APawn* Pawn = FUE4CVServer::Get().GetPawn();
CameraRotation = Pawn->GetControlRotation();
}
FString Message = FString::Printf(TEXT("%.3f %.3f %.3f"), CameraRotation.Pitch, CameraRotation.Yaw, CameraRotation.Roll);
return FExecStatus::OK(Message);
}
return FExecStatus::Error("Number of arguments incorrect");
}
示例3: GetCameraPose
FExecStatus FCameraCommandHandler::GetCameraPose(const TArray<FString>& Args)
{
if (Args.Num() == 1)
{
bool bIsMatinee = false;
FVector CameraLocation;
FRotator CameraRotation;
ACineCameraActor* CineCameraActor = nullptr;
for (AActor* Actor : this->GetWorld()->GetCurrentLevel()->Actors)
{
// if (Actor && Actor->IsA(AMatineeActor::StaticClass())) // AMatineeActor is deprecated
if (Actor && Actor->IsA(ACineCameraActor::StaticClass()))
{
bIsMatinee = true;
CameraLocation = Actor->GetActorLocation();
CameraRotation = Actor->GetActorRotation();
break;
}
}
if (!bIsMatinee)
{
// int32 CameraId = FCString::Atoi(*Args[0]); // TODO: Add support for multiple cameras
// This should support multiple cameras
// UGTCaptureComponent* CaptureComponent = FCaptureManager::Get().GetCamera(CameraId);
// if (CaptureComponent == nullptr)
// {
// return FExecStatus::Error(FString::Printf(TEXT("Camera %d can not be found."), CameraId));
// }
// CameraLocation = CaptureComponent->GetComponentLocation();
// CameraRotation = CaptureComponent->GetComponentRotation();
APawn* Pawn = FUE4CVServer::Get().GetPawn();
CameraLocation = Pawn->GetActorLocation();
CameraRotation = Pawn->GetControlRotation();
}
FString Message = FString::Printf(TEXT("%.3f %.3f %.3f %.3f %.3f %.3f"),
CameraLocation.X, CameraLocation.Y, CameraLocation.Z,
CameraRotation.Pitch, CameraRotation.Yaw, CameraRotation.Roll);
return FExecStatus::OK(Message);
}
return FExecStatus::Error("Number of arguments incorrect");
}