CesiumGS / cesium-native

Apache License 2.0
391 stars 200 forks source link

Fix two bugs with polygon clipping #917

Closed kring closed 2 weeks ago

kring commented 2 weeks ago

Fixes #914 Fixes CesiumGS/cesium-unreal#1461

I should really write some tests for the bounding volume changes...

kring commented 2 weeks ago

I still found a tile that didn't want to be excluded, though it seems to be a one-off?

I'm not sure. I wasn't able to find a case that was working incorrectly, but I can't promise no such case exists. At any rate, before this PR, small-ish tiles were never excluded. So this PR is surely an improvement. If we find a problem case later we'll just have to fix it then.

I wasn't sure how to reproduce the other error you were fixing (though, it seemed like it was fickle to reproduce). If there's a reliable way to see this error, I can sanity check it on my end.

The key is to use Google Photorealistic 3D Tiles and set up your clipping polygon in an area with a lot of tall buildings. Then fly around within the clipping area, zoomed in pretty close, and bits of building will randomly appear.

j9liu commented 2 weeks ago

Thanks @kring ! I just fixed a typo in the changelog entry + reworded it slightly. Merging now!