Hi everyone,
We are building a mobile application using Cesium for Unity where users navigate the globe using touch controls (pan, zoom, tilt).
We observed that when the camera moves downward, it can go inside the terrain unless constrained.
We experimented with enabling “Create Physics Meshes” on the Cesium 3D Tileset, and noticed that it appears to prevent the camera from entering the terrain because MeshColliders are generated. However, we are concerned about:
• Performance and memory impact on mobile
• Streaming / LOD transitions causing unreliable collision behavior
• Whether this is an unintended side effect rather than a supported approach
Instead, we are considering a terrain-aware camera height clamp, where:
• The camera’s latitude / longitude / height are read via CesiumGlobeAnchor
• Terrain height is sampled using CesiumTerrainProvider.SampleHeightMostDetailed()
• A minimum height buffer (e.g., 50–100 meters) is enforced
• The correction is applied smoothly in LateUpdate()
This avoids physics entirely and keeps camera behavior deterministic and mobile-friendly.
Questions for the community:
-
Is terrain-based height clamping the recommended approach for camera safety in Cesium for Unity?
-
Are physics meshes intended to be used for camera collision, or only for gameplay / character interaction?
-
Are there any Cesium-native camera constraints or best practices we should follow for globe navigation?
Any guidance or confirmation from the Cesium team or community would be appreciated.
Thanks in advance