[C++] How to place/transform an actor ? (which coordinates ?)


I would like, in C ++, to place objects in a Cesium scene in Unreal Engine from coordinates sent in DIS.

GetWorld () → SpawnActor (MyHelicopterReference, Location, Rotation, SpawnParameters);
// How to compute location? in which space?

How can I do ? Do the coordinates of the object have to be in Unreal’s world coordinate system?

I saw that there is a TransformLongitudeLatitudeHeightToUe () function. Can it be of use to me and how do I use it? Is it possible to have access to cesium classes in our c++ project ?

Hello @Gregory_S,

You can retrieve a pointer to the ACesiumGeoreference actor by using the static ACesiumGeoreference::GetDefaultForActor function. On this actor you can find the TransformLongitudeLatitudeHeightToUe, TransformEcefToUe, and other useful conversion functions.

Currently your input coordinates need to be in WGS84 longitude/latitude/height or Earth-Centered, Earth-Fixed (ECEF).

Let me know if anything isn’t clear!

Nithin Pranesh


Maybe my question is stupid, but how can I get access to the Cesium plugin in my c ++ code?

#include <CesiumGeoreference.h> is not accessible

I added “CesiumRuntime” in MyProject.Build.cs:
PublicDependencyModuleNames.AddRange (new string {“Core”, “CoreUObject”, “Engine”, “InputCore”, “CesiumRuntime”});

Is there anything else to be done?

1 Like

It works after several compilations and restarts

1 Like