Small review changes
This commit is contained in:
parent
9a2fe68dd8
commit
b4a6700adc
|
|
@ -24,10 +24,8 @@ MetadataQuery::findFirstPropertyWithSemantic(
|
|||
|
||||
const Cesium3DTiles::Class& klass = classIt->second;
|
||||
|
||||
for (const auto& propertie : entity.properties) {
|
||||
const std::pair<std::string, CesiumUtility::JsonValue>& property =
|
||||
propertie;
|
||||
auto propertyIt = klass.properties.find(property.first);
|
||||
for (const auto& propertyValue : entity.properties) {
|
||||
auto propertyIt = klass.properties.find(propertyValue.first);
|
||||
if (propertyIt == klass.properties.end())
|
||||
continue;
|
||||
|
||||
|
|
@ -36,9 +34,9 @@ MetadataQuery::findFirstPropertyWithSemantic(
|
|||
return FoundMetadataProperty{
|
||||
classIt->first,
|
||||
classIt->second,
|
||||
propertie.first,
|
||||
propertyValue.first,
|
||||
propertyIt->second,
|
||||
propertie.second};
|
||||
propertyValue.second};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,40 +25,6 @@ using namespace CesiumGeospatial;
|
|||
|
||||
namespace Cesium3DTilesSelection {
|
||||
|
||||
namespace {
|
||||
|
||||
template <class T>
|
||||
bool isBoundingVolumeVisible(
|
||||
const T& boundingVolume,
|
||||
const CullingVolume& cullingVolume) noexcept {
|
||||
const CullingResult left =
|
||||
boundingVolume.intersectPlane(cullingVolume.leftPlane);
|
||||
if (left == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult right =
|
||||
boundingVolume.intersectPlane(cullingVolume.rightPlane);
|
||||
if (right == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult top =
|
||||
boundingVolume.intersectPlane(cullingVolume.topPlane);
|
||||
if (top == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult bottom =
|
||||
boundingVolume.intersectPlane(cullingVolume.bottomPlane);
|
||||
if (bottom == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
/* static */ ViewState ViewState::create(
|
||||
const glm::dvec3& position,
|
||||
const glm::dvec3& direction,
|
||||
|
|
@ -103,6 +69,39 @@ ViewState::ViewState(
|
|||
horizontalFieldOfView,
|
||||
verticalFieldOfView)) {}
|
||||
|
||||
namespace {
|
||||
template <class T>
|
||||
bool isBoundingVolumeVisible(
|
||||
const T& boundingVolume,
|
||||
const CullingVolume& cullingVolume) noexcept {
|
||||
const CullingResult left =
|
||||
boundingVolume.intersectPlane(cullingVolume.leftPlane);
|
||||
if (left == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult right =
|
||||
boundingVolume.intersectPlane(cullingVolume.rightPlane);
|
||||
if (right == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult top =
|
||||
boundingVolume.intersectPlane(cullingVolume.topPlane);
|
||||
if (top == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CullingResult bottom =
|
||||
boundingVolume.intersectPlane(cullingVolume.bottomPlane);
|
||||
if (bottom == CullingResult::Outside) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
bool ViewState::isBoundingVolumeVisible(
|
||||
const BoundingVolume& boundingVolume) const noexcept {
|
||||
// TODO: use plane masks
|
||||
|
|
|
|||
Loading…
Reference in New Issue