本文整理汇总了C++中FRotator::Euler方法的典型用法代码示例。如果您正苦于以下问题:C++ FRotator::Euler方法的具体用法?C++ FRotator::Euler怎么用?C++ FRotator::Euler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRotator
的用法示例。
在下文中一共展示了FRotator::Euler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawAngles
static void DrawAngles(FCanvas* Canvas, int32 XPos, int32 YPos, EAxisList::Type ManipAxis, FWidget::EWidgetMode MoveMode, const FRotator& Rotation, const FVector& Translation)
{
FString OutputString(TEXT(""));
if (MoveMode == FWidget::WM_Rotate && Rotation.IsZero() == false)
{
//Only one value moves at a time
const FVector EulerAngles = Rotation.Euler();
if (ManipAxis == EAxisList::X)
{
OutputString += FString::Printf(TEXT("Roll: %0.2f"), EulerAngles.X);
}
else if (ManipAxis == EAxisList::Y)
{
OutputString += FString::Printf(TEXT("Pitch: %0.2f"), EulerAngles.Y);
}
else if (ManipAxis == EAxisList::Z)
{
OutputString += FString::Printf(TEXT("Yaw: %0.2f"), EulerAngles.Z);
}
}
else if (MoveMode == FWidget::WM_Translate && Translation.IsZero() == false)
{
//Only one value moves at a time
if (ManipAxis == EAxisList::X)
{
OutputString += FString::Printf(TEXT(" %0.2f"), Translation.X);
}
else if (ManipAxis == EAxisList::Y)
{
OutputString += FString::Printf(TEXT(" %0.2f"), Translation.Y);
}
else if (ManipAxis == EAxisList::Z)
{
OutputString += FString::Printf(TEXT(" %0.2f"), Translation.Z);
}
}
if (OutputString.Len() > 0)
{
FCanvasTextItem TextItem( FVector2D(XPos, YPos), FText::FromString( OutputString ), GEngine->GetSmallFont(), FLinearColor::White );
Canvas->DrawItem( TextItem );
}
}