Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect ECEF->LLH transformation in CesiumCartographicPolygon. #482

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

kring
Copy link
Member

@kring kring commented Jul 31, 2024

After #465, CesiumCartographicPolygon was incorrectly calling LongitudeLatitudeHeightToCenteredFixed when attempting to transform ECEF to Longitude/Latitude/Height. That is, it was transforming in the wrong direction. This made the vertex positions in the polygon incorrect, breaking the polygon functionality completely.

Reported here:
https://community.cesium.com/t/cesiumpolygonrasteroverlay-can-not-clip-vectortilemap-in-v1-11/34093

@kring
Copy link
Member Author

kring commented Jul 31, 2024

@csciguy8 can you please review and merge this one today so that we can include it in tomorrow's release?

@kring kring requested a review from csciguy8 July 31, 2024 06:04
@kring kring added this to the August 2024 Release milestone Jul 31, 2024
@@ -138,7 +138,7 @@ internal List<double2> GetCartographicPoints(Matrix4x4 worldToTileset)
float3 worldPosition = knot.Transform(localToWorld).Position;
float3 unityPosition = worldToTileset.MultiplyPoint3x4(worldPosition);
double3 ecefPosition = georeference.TransformUnityPositionToEarthCenteredEarthFixed(unityPosition);
double3 cartographicPosition = georeference.ellipsoid.LongitudeLatitudeHeightToCenteredFixed(ecefPosition);
double3 cartographicPosition = georeference.ellipsoid.CenteredFixedToLongitudeLatitudeHeight(ecefPosition);
Copy link
Contributor

@csciguy8 csciguy8 Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the original PR that introduced this bug.

Pretty sure it was just a typo that the author and reviewer (me!) both missed.

I also looked at the diffs for that PR again to make sure there weren't similar instances.

Copy link
Contributor

@csciguy8 csciguy8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kring for the catch and the new test.

Looks good.

@csciguy8 csciguy8 merged commit dc29f2b into main Jul 31, 2024
7 checks passed
@csciguy8 csciguy8 deleted the transform-direction branch July 31, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants