cesium
cesium copied to clipboard
fix scene.updateHeight
Description
There where some performance issues in Scene.updateHeight
which made working with large (mesh surfaces in general) 3D Tiles difficult to very clunky.
Proposed fixes
- In
Cesium3DTileset.js
, update height callbacks where wrapped in an object, with aninvoked
property. This property was alwaysfalse
. In the PR, we set it to true once an update has been added to the frame state and set it back to false on flush. - In
Scene.updateHeight
a callback can be called more then once for the same frame number. We now ensure it is only called once. - In
Scene.updateHeight
a callback which was removed would still be called with a new height. When loading a mesh surface, multiple callbacks are added, one for each initialized frame. For each new one added, the old one is removed, but still called once. We now only call callbacks which where not removed.
Testing plan
Add a mesh surface with enableCollision
and watch your performance drop.
Author checklist
- [x] I have submitted a Contributor License Agreement
- [x] I have added my name to
CONTRIBUTORS.md
- [x] I have updated
CHANGES.md
with a short summary of my change - [x] I have added or updated unit tests to ensure consistent code coverage
- [x] I have updated the inline documentation, and included code examples where relevant
- [x] I have performed a self-review of my code