FRotation FVector 相互转换

FVector to FRotator

FRotator FVector::Rotation() const
{
    return ToOrientationRotator();
}

FRotator to FVector

CORE_API FVector FRotator::Vector() const
{
    float CP, SP, CY, SY;
    FMath::SinCos( &SP, &CP, FMath::DegreesToRadians(Pitch) );
    FMath::SinCos( &SY, &CY, FMath::DegreesToRadians(Yaw) );
    FVector V = FVector( CP*CY, CP*SY, SP );

    return V;
}

你可能感兴趣的:(FRotation FVector 相互转换)