CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
885 stars 286 forks source link

`DynamicPawn` can get stuck underground if flying with speed multiplier #1419

Open j9liu opened 2 months ago

j9liu commented 2 months ago

This can be reproduced in any Cesium level with a DynamicPawn. (I used 04_MAIN_CesiumSubLevels)

  1. Fly out far away, enough that you can almost see the entire globe
  2. Start flying back towards the globe, but speed up the zoom using the scroll wheel.

When you maintain that speed, the camera will phase through the ground, and because there's no terrain underneath to raycast, it's really hard to get back above ground again.

This seems to happen even with moderate speed-up, like "half a scroll wheel" of input.

csciguy8 commented 2 months ago

I wonder if this can be solved by just turning off raycasts if higher than a certain threshold?

For example, at 100km above the earth, just use our height above the ellipsoid. A raycast isn't going to hit anything that's going to change this distance in a significant way.