Make coordinates in point cloud chunks independent from scene origin #58948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Until now, coordinates of chunks of point clouds were using "world" coordinates, i.e. they were relative to the 3D scene origin point. As a part of preparation for large scene support (QEP 301), we need coordinates inside chunks to be independent from the scene origin point. For each point cloud chunk, we pick origin point as a corner of the chunk's 3D box, which should guarantee that coordinates within chunk (floats) will have reasonable numerical precision.
I have also used the opportunity to simplify the code that handles point cloud chunk coordinates: rather than having flipped coordinates (x,-z,y) inside chunks, we are using map coordinates without flipping (x,y,z), only relative to the origin point of the chunk. The flipping of axes is handled by QTransform attached to each chunk. (Hopefully when all chunked entity implementations get updated, we will be able to remove all the axis flipping everywhere by just removing the rotation in associated QTransforms.)
There's also a fix for a crash, when point cloud uses coloring based on classification and triangulation is enabled (the pointSize array was not getting populated for parent nodes).