CesiumGS / cesium-native

Apache License 2.0
414 stars 210 forks source link

Fix `estimateGlobeRectangle` for boxes and spheres that encompass the entire globe #808

Closed lilleyse closed 6 months ago

lilleyse commented 7 months ago

Fixes https://github.com/CesiumGS/cesium-native/issues/803 by returning the maximum rectangle if the box or sphere contains (0, 0, 0)

kring commented 6 months ago

Thanks @lilleyse, looks good! There's of course the possibility of large bounding sphere, such as covering a quarter of the globe, being incorrectly flagged as covering the whole globe just because it happens to contain the center. But generally it's better to return a rectangle that is too large than one that is too small, so this is a definite improvement.