CesiumGS / CesiumGS/cesium

Dynamic entities expect to live forever?

Open
#8,159 4 comments 0 reactions 0 assignees View on GitHub
category - entity type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

This [came up in this forum thread](https://groups.google.com/d/msg/cesium-dev/2Nzjsy9-YFQ/d63m46j2BAAJ).

This is an entity with an ellipsoid with a dynamic radius. Trying to change it to an ellipse at run-time crashes because the geometry updater expects the entity to always be defined.

[Sandcastle link](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html#c=hVPLctsgFP0VRhtLHRXZTbrxaxo/dsmkE6ddaYPRlUWNwMPDjtvxvxeEVNt1M2WB4HLu4d5z0J4otGdwAIUmSMABzUEzW+PvTSzu0WY7l8IQJkD1UvQrF8gNXUnLiwfBamJgiIyykItTMspFLvaOdM0tzOSbYw30GIRhhoHGpCjilmQntYtJMeyunRNl3IqIO1wqWS9gowB0/HEwuE/RfR/3U3TX9wP3kzRwAOdspyUr0LCrzY8sU6RgzAUvujrTx58bmhRdfztSP/6Zz/ma0O1XJXegzDHegHnxsBSVhGu4TPe6KEY4OjcnuVT4ZbkIoNMfvUorqJcBdXRx0rXipfSFWO2UfCKmwmSt42ZBpY5bbSmXdIupVcqp/MpqwBqoFIV+LhfkmCToQ9vfKLCGWYGxSryjT7g0RdffUO/JTysiCkq04eAdfZXSKaNm1hgp4t7qwAytkJFo2dgD7uF0XcZJ21v7RPDZwQmyooDSvbSiuegWBQ5z4XIeaajZExNSPbwxnUdO7e6BpDcw8uN/sArYpjLN+afb8/csnT1+W7aejhpTozQaa3PkMA3hL6zeSWWQVTzGODNQ77jj0tna0i0YTHWj7DjrksYF2yNWTPLorx/QlUY50dqdlJbzFfsJeTQdZw5/lcal80tsnvegODl6SDWYPoYgxnicue1tlgkuOrgvJpz+Bg).

This works fine if the ellipsoid is not dynamic. This seems to be a problem with all dynamic entities. Originally, when I asked why CesiumJS was designed to have one abstract "entity" with properties for each geometry type, instead of just creating `new PolygonEntity()`, the reason was that an Entity can be one shape, multiple shapes at the same time, or different shapes across time.

So I think it makes sense to consider this a bug, that you can't get rid of dynamic entities by setting them to undefined.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash with the linked Sandcastle example: use an entity with a dynamic ellipsoid radius, then change the geometry to undefined at runtime. Trace the geometry updater involved in that transition and verify that dynamic entities can be removed without a crash, including when their geometry changes over time.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.