About the guide of "Build a flight tracker"

I followed the tutorial to the Step 4 and tried to compile the code. Then the VS2019 said that “class
‘ACesiumGeoreference’ has no member ‘TransformLongitudeLatitudeHeightToUe’”.

Here is my code…

// Copyright 2020-2021 CesiumGS, Inc. and Contributors


#include "PlaneTrack.h"

// Sets default values
APlaneTrack::APlaneTrack()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	// Initialize the track
	SplineTrack = CreateDefaultSubobject<USplineComponent>(TEXT("SplineTrack"));
	// This lets us visualize the spline in Play mode
	SplineTrack->SetDrawDebug(true);
	// Set the color of the spline
	SplineTrack->SetUnselectedSplineSegmentColor(FLinearColor(1.f, 0.f, 0.f));
}

// Called when the game starts or when spawned
void APlaneTrack::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void APlaneTrack::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

void APlaneTrack::LoadSplineTrackPoints()
{
    if (this->AircraftsRawDataTable != nullptr && this->CesiumGeoreference != nullptr)
    {
        int32 PointIndex = 0;
        for (auto& row : this->AircraftsRawDataTable->GetRowMap())
        {
            FAircraftRawData* Point = (FAircraftRawData*)row.Value;
            // Get row data point in lat/long/alt and transform it into UE4 points
            double PointLatitude = Point->Latitude;
            double PointLongitude = Point->Longitude;
            double PointHeight = Point->Height;

            // Compute the position in UE coordinates
            //this->CesiumGeoreference = ACesiumGeoreference::GetDefaultGeoreference(this);
            glm::dvec3 UECoords = this->CesiumGeoreference->TransformLongitudeLatitudeHeightToUe(glm::dvec3(PointLongitude, PointLatitude, PointHeight));
            FVector SplinePointPosition = FVector(UECoords.x, UECoords.y, UECoords.z);
            this->SplineTrack->AddSplinePointAtIndex(SplinePointPosition, PointIndex, ESplineCoordinateSpace::World, false);

            // Get the up vector at the position to orient the aircraft
            const CesiumGeospatial::Ellipsoid& Ellipsoid = CesiumGeospatial::Ellipsoid::WGS84;
            glm::dvec3 upVector = Ellipsoid.geodeticSurfaceNormal(CesiumGeospatial::Cartographic(FMath::DegreesToRadians(PointLongitude), FMath::DegreesToRadians(PointLatitude), FMath::DegreesToRadians(PointHeight)));

            // Compute the up vector at each point to correctly orient the plane
            glm::dvec4 ecefUp(upVector, 0.0);
            const glm::dmat4& ecefToUnreal = this->CesiumGeoreference->GetEllipsoidCenteredToUnrealWorldTransform();
            glm::dvec4 unrealUp = ecefToUnreal * ecefUp;
            this->SplineTrack->SetUpVectorAtSplinePoint(PointIndex, FVector(unrealUp.x, unrealUp.y, unrealUp.z), ESplineCoordinateSpace::World, false);

            PointIndex++;
        }
        this->SplineTrack->UpdateSpline();
    }
}

Not really experienced with unreal or c++ so I’d appreciate any help you can give. Thanks

The newest version of the Cesium for Unreal plugin updated some of their function names. That one specifically was changed to TransformLongitudeLatitudeHeightToUnreal.

Hi @niymoriy,

Shadowedice is correct, this function was renamed to TransformLongitudeLatitudeHeightToUnreal. I’m somewhat behind on updating tutorials, so thanks for pointing this one out - I’ll update it right away.

Please let me know if you’re still running in to trouble with the tutorial after changing the function name.

Thank you so much.

Thank you for replying. This problem is solved.

But I see in the change log that GetEllipsoidCenteredToUnrealWorldTransform has also been changed. And I don’t know how to fix this.

Hi @niymoriy,

Another user found a workaround for this here: Cesium for Unreal v1.7.0 has been released. Here’s a guide to upgrading - #3 by creplogle

In particular, you’ll want to replace the line

const glm::dmat4& ecefToUnreal = this->CesiumGeoreference->GetEllipsoidCenteredToUnrealWorldTransform();

with

const GeoTransforms& geoTransforms = this->CesiumGeoreference->GetGeoTransforms();
const glm::dmat4& ecefToUnreal = geoTransforms.GetEllipsoidCenteredToAbsoluteUnrealWorldTransform();

I’ll update the tutorials accordingly.

Tested it out on my end and the flight tracker code is now working after these two fixes, but please let me know if you are still running in to trouble!