Open javagl opened 2 months ago
Here's another Sandcastle which breaks with the same stack
Adding a
osmBuildingsTileset.modelMatrix = Cesium.Matrix4.fromTranslation(
new Cesium.Cartesian3(0.001, 0.001, 0.001));
"fixes" that. (Not sure which smiley to insert here).
I think a viable approach for a first "triage" pass on this issue would be to search for all calls to cartesianToCartographic
, see what is done with the result, and handle the undefined
return case accordingly. In both cases described here so far, it was passed to the respective projection
, and I could imagine that some of that could be solved somewhat pragmatically, with something like
if (!defined(cartographic)) {
// Input was origin...
cartesian.x = 0.0;
cartesian.y = 0.0;
} else { ... project ... }
When creating an entity at (0,0,0), it crashes with
Sandcastle:
https://sandcastle.cesium.com/index.html#c=dY/BSsQwEIZfZeiphZK6eFu7RehV8CB46iVtRh02nZRM2nWVfXeT9rLoCnPI/Pm+n2RwLAEWwhN6OADjCVoUmkf1umZ5lw3r3joOmhh9lxUPHW+GQg4UCEVpY/LvjgEmJzFxvL/uarUP8aT5Pr8rIU1RJrh3n3tYNQBDI7JEU/5TdyWkKRJ/if4lPSQrs1rC2WKz1QA80jg5H2D2NleqCjhOVseOqp+HIwY1iCQxoXV1rdaGFiBzuPFlGKwWiTdvs7Uv9IVd1tRV5P+o1mlD/P68oLf6nLCPXfO0hUqpuorrbTM4Z3vtfzX/AA
It's pretty simple:
This is caused here: https://github.com/CesiumGS/cesium/blob/89d15af5d2c0338a59f91f3dfa666ad8478f694b/packages/engine/Source/Scene/Primitive.js#L1530
The
cartesianToCartographic
function is returningundefined
when receiving the center.(I'll just put it at (0, 0, 1e-15) for now...)