Bounding volume generalizations #189
Draft
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.
This is a minor generalization, aiming at providing what is necessary to implement CesiumGS/3d-tiles-validator#233
As part of the
createTilesetJsoncommand, there already was aContentBoundingVolumesclass that could compute the bounding volume (box) for arbitrary content data (PNTS, B3DM, CMPT, I3DM, most boiling down to GLB). The computation was just iterating over all points of PNTS or "positions" that had been found in the GLB data, possibly transforming them with some RTC_CENTER or whatnot, and computing an oriented bounding box from these positions.With this PR, the whole iteration over the points is moved into a dedicated
VertexProcessingclass that just passes the resulting positions to some arbitrary "consumer". TheContentBoundingVolumesclass now just uses this class, and "consumes" the points by collecting them in an array and eventually computing the bounding volume of these points.I also stated a
BoundingVolumesContainmentclass that contains methods for checking whether a certain point is contained in a bounding volume. This may eventually be used by the validator: It will establish a "consumer" that processes the vertex positions by checking whether they are contained in the bounding volumes (and create an error/warning when this is not the case)I'll keep this as a 'draft' for now, because I'd like to make sure that it's actually possible to implement the counterpart of this in the 3D Tiles Validator, based on this state.