cesium
cesium copied to clipboard
Fix camera collision on tileset load
Description
Merge https://github.com/CesiumGS/cesium/pull/11829 first!
This ensures the scene is subscribed to tileset height updates, ie. when a tile loads. The subscription requires the current position, so it should only check for updates when a tile above or below the provided position loads in, and we reset the subscription when the camera position changes.
This is a similar workflow to how clamp to ground works, which is why these functions already exist.
Issue number and link
Fixes https://github.com/CesiumGS/cesium/issues/11824
Testing plan
- Go to the Google 3D Tiles Sandcastle
- Use the geocoder to navigate to the Grand Canyon
- Quickly move the camera down and underground before the view is stable. The camera should no longer ever get "stuck" under terrain as it does in main.
- Ensure consistant FPS with Google P3DT
- Repeat the above steps with CWT
Author checklist
- [x] I have submitted a Contributor License Agreement
- [x] I have added my name to
CONTRIBUTORS.md - [x] I have updated
CHANGES.mdwith a short summary of my change - [x] I have added or updated unit tests to ensure consistent code coverage
- [ ] ~I have update the inline documentation, and included code examples where relevant~
- [x] I have performed a self-review of my code
- [ ] https://github.com/CesiumGS/cesium/pull/11829 is merged