Hi, I use this code to move forward, but it will move down and forward
this->_moveAlongViewAxis(EAxis::X, Val);
I just want to move along the ellipsoid
Hi, I use this code to move forward, but it will move down and forward
this->_moveAlongViewAxis(EAxis::X, Val);
I just want to move along the ellipsoid
Hello @http3w ,
You may be able to try creating a longitude-latitude-height values that gradually change when given input. In Tick, you can use the updated longitude-latitude-height to set the position of your actor. Adjusting only the longitude-latitude will let you move along the ellipsoid. To convert from longitude-latitude-height to Unreal coordinates, you will need to use the conversion functions on the CesiumGeoreference
. Let me know if that idea works for your use case!
@Nithin_Pranesh thanks for your reply. That’s right;
this my code:
FVector LongitudeLatitude = GlobeAnchor->InaccurateGetLongitudeLatitudeHeight();
FVector UnrealForwardVector = FRotationMatrix(FRotator(Controller->GetControlRotation())).GetScaledAxis(EAxis::Y) * Val * -10000.f + GetActorLocation();
FVector UnrealToLongitudeLatitude = GlobeAnchor->GetGeoreference()->InaccurateTransformUnrealToLongitudeLatitudeHeight(UnrealForwardVector);
FVector UnrealVector = GlobeAnchor->GetGeoreference()->InaccurateTransformLongitudeLatitudeHeightToUnreal(FVector(UnrealToLongitudeLatitude.X, UnrealToLongitudeLatitude.Y , LongitudeLatitude.Z));
SetActorLocation(UnrealVector);