Object sinking into the terrain. Assistance required please

Hello Team Cesium. Since I am a relatively new user and this is my first post here, I would like to thank you for this amazing piece of software. It has really transformed my experience in Unreal Engine.

I have been working on a flight sim using Cesium and UE. Unfortunately I have run into a problem that I cannot seem to figure out.

I am using the template from the DIY Flight sim tutorial A DIY Flight Simulator tutorial | Tutorial (epicgames.com) and I have everything set up. Now my aircraft has two cameras attached to it. One is Orbit camera which is basically 3rd person camera and the other is Pilot camera which gives the view from the cockpit. The aircraft interacts with the cesium terrain perfectly while in Orbit camera and I can takeoff and land on the runway. (I am using the default bing imagery runways and not using any other meshes.) But as soon as I switch to the Pilot Camera, the aircraft instantly sinks into the ground and the simulation stops… Its as if there were holes in the terrrain when in Pilot Camera mode. This is wierd because this does not happen in the Orbit camera view. So I am very sure this has to do with the camera system. I have Forbid holes option checked aswell.

Please advise.

Thanks

Cesium for Unreal needs to use particular cameras to drive tile selection. At runtime, it finds the camerase to use with this GetPlayerCameras function:

My guess is that your orbit camera is configured with the player controller’s APlayerCameraManager, so when it is in use, everything is fine. But perhaps the other camera is not. So when you switch cameras, Cesium still tries to use the old one, but it is now invalid (width and height of 0 pixels, maybe), so no tiles are selected at all.

This is just a guess, though. I’d suggest stepping through the code linked above in Cesium3DTileset.cpp using the Visual Studio debugger, and see if you can identify where it’s going wrong in your case.

Kevin

Thanks Kevin.

I have absolutely no idea how to go through the possible solution you mentioned above sadly. I would be thankful if you can guide me through the process maybe ?

Those are only ideas for how to debug it, I can’t give you a specific solution because I don’t know exactly what is happening. If you haven’t used the Visual Studio debugger before I don’t think I can guide you through the process via the forum. You might try starting with a video like this one (it looks promising, but I haven’t actually watched it myself):

Thanks. Watching it right now.