get texture coordinate index of implicit context projection

This commit is contained in:
Joseph Kaile 2022-05-09 12:30:27 -04:00
parent 11b06edc9a
commit e1880746ce
2 changed files with 21 additions and 4 deletions

View File

@ -462,10 +462,8 @@ void createImplicitChildrenIfNeeded(
std::vector<Projection>& projections =
content.overlayDetails->rasterOverlayProjections;
const Projection& projection = *implicitContext.projection;
auto it = std::find(
projections.begin(),
projections.end(),
*implicitContext.projection);
auto it =
std::find(projections.begin(), projections.end(), projection);
if (it == projections.end()) {
projections.emplace_back(projection);
int32_t firstCoordinateIndex = int32_t(projections.size()) - 1;

View File

@ -983,6 +983,25 @@ void Tile::upsampleParent(
void* pRendererResources;
};
int32_t index = 0;
const gsl::span<Tile> children = pParent->getChildren();
if (std::get_if<QuadtreeTileID>(&pParent->getTileID()) &&
std::any_of(
children.begin(),
children.end(),
[](const Tile& tile) noexcept {
return std::get_if<QuadtreeTileID>(&tile.getTileID());
})) {
TileContentLoadResult& content = *pParent->getContent();
std::vector<Projection>& parentProjections =
content.overlayDetails->rasterOverlayProjections;
const Projection& projection = *_pContext->implicitContext->projection;
auto it = std::find(parentProjections.begin(), parentProjections.end(), projection);
index = int32_t(it - parentProjections.begin());
}
pTileset->getAsyncSystem()
.runInWorkerThread(
[&parentModel,