Hello!
I have a set of coordinates, ECEF + Euler angles that I want to display in Unreal using the Cesium plugin.
Converting from ECEF to UE is easy using TransformEcefToUe but what about the orientation?
Thanks!
Hello!
I have a set of coordinates, ECEF + Euler angles that I want to display in Unreal using the Cesium plugin.
Converting from ECEF to UE is easy using TransformEcefToUe but what about the orientation?
Thanks!
I’m facing same problems. After searching in the plugin code repo, I found a function that might help.
CesiumGeoreferenceComponent->Georeference->TransformRotatorEnuToUe()
Enu for East North Up.
Hello,
I had already tested with that function without any success. We ended up using code we already used for another project.
I think there is a small part missing before using the TransfortRotatorEnuToEU() function that would need to take into account the original coordinates to correctly convert to orientation to Unreal.
I’m still interested in understanding how to do that entirely using the Cesium API.
Let me know if you have any progress on your end.
Sorry for being late. The code may be cumbersome and need some simplification, but somehow works.
void AAircraftPawn::RotateToRollYawPitch(double Roll, double Yaw, double Pitch)
{
FVector UELocation = GetActorLocation();
glm::dvec3 UELocation_dvec3(UELocation.X, UELocation.Y, UELocation.Z);
/*
Basically, those confusing "-" symbols are just because the value is positive,
but my 3D model rotates in negative direction. It may be different in your project depending on
the settings when importing models to UE. The reason for "-180", and the order of parameters of
"FVector(-Pitch, -Roll, -Yaw-180)" are similar.
*/
FRotator TargetRotator = this->CesiumGeoreferenceComponent->Georeference->TransformRotatorEnuToUe(FRotator::MakeFromEuler(FVector(-Pitch, -Roll, -Yaw-180)), UELocation_dvec3);
TargetRotator.Pitch = -TargetRotator.Pitch;
TargetRotator.Yaw = -TargetRotator.Yaw;
SetActorRotation(TargetRotator);
}