Hey @pilgrimstranger,
I believe the reason position working but rotation is wrong is because, if I remember correctly, ECEF is right-handed and Unreal Engine is left-handed, so there is no purely rotational mapping between the two. An identity quaternion in ECEF doesn’t correspond to identity in Unreal’s display, which is why you’re seeing [0, -90, 90] even though the quaternion you sent was [0, 0, 0, 1]. That rotation is actually the Unreal-coordinate representation of “axes aligned with ECEF” at that position on the Moon’s surface.
There are two existing threads that work through this exact problem:
The key solution from the first thread: you need to multiply your ECEF rotation against ComputeEarthCenteredEarthFixedToUnrealTransformation(), but you cannot call RemoveScaling() on the result. The scale in that matrix encodes the reflection that handles the left-to-right-hand conversion. Then extract the quaternion using the scaled axes:
const FMatrix ECEFToUnreal = CesiumGeoreference->ComputeEarthCenteredEarthFixedToUnrealTransformation();
const FMatrix FinalRotation = socket_data.ECEFRotation.ToMatrix() * ECEFToUnreal;
const FVector XAxis = FinalRotation.GetScaledAxis(EAxis::X);
const FVector YAxis = FinalRotation.GetScaledAxis(EAxis::Y);
const FQuat UnrealQuat = FRotationMatrix::MakeFromXY(XAxis, YAxis).ToQuat();
Let me know if the above gets you closer!