Skip to content

Commit

Permalink
Parse cylinder properly
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed Dec 23, 2024
1 parent 0a96f69 commit f81e934
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ std::optional<BoundingVolume> getBoundingVolumeProperty(
ellipsoid);
}

const auto cylinderIt = extensionsIt->value.FindMember(
const auto cylinderExtensionIt = extensionsIt->value.FindMember(
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder::ExtensionName);
if (cylinderIt != extensionsIt->value.MemberEnd() &&
cylinderIt->value.IsObject()) {
if (cylinderExtensionIt != extensionsIt->value.MemberEnd() &&
cylinderExtensionIt->value.IsObject()) {
const auto cylinderIt = cylinderExtensionIt->value.FindMember("cylinder");
if (cylinderIt == cylinderExtensionIt->value.MemberEnd() ||
!cylinderIt->value.IsArray()) {
return std::nullopt;
}

const auto& a = cylinderIt->value.GetArray();
for (rapidjson::SizeType i = 0; i < 12; ++i) {
if (!a[i].IsNumber()) {
Expand Down

0 comments on commit f81e934

Please sign in to comment.