mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 19:56:48 +02:00
fix updateQueryAACube return-value
This commit is contained in:
parent
f2cb5d4aff
commit
633f63df54
1 changed files with 26 additions and 24 deletions
|
@ -970,31 +970,33 @@ bool SpatiallyNestable::updateQueryAACube() {
|
||||||
|
|
||||||
bool success;
|
bool success;
|
||||||
AACube maxAACube = getMaximumAACube(success);
|
AACube maxAACube = getMaximumAACube(success);
|
||||||
if (success) {
|
if (!success) {
|
||||||
if (shouldPuffQueryAACube()) {
|
return false;
|
||||||
// make an expanded AACube centered on the object
|
|
||||||
float scale = PARENTED_EXPANSION_FACTOR * maxAACube.getScale();
|
|
||||||
_queryAACube = AACube(maxAACube.calcCenter() - glm::vec3(0.5f * scale), scale);
|
|
||||||
_queryAACubeIsPuffed = true;
|
|
||||||
} else {
|
|
||||||
_queryAACube = maxAACube;
|
|
||||||
_queryAACubeIsPuffed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
forEachDescendant([&](const SpatiallyNestablePointer& descendant) {
|
|
||||||
bool childSuccess;
|
|
||||||
AACube descendantAACube = descendant->getQueryAACube(childSuccess);
|
|
||||||
if (childSuccess) {
|
|
||||||
if (_queryAACube.contains(descendantAACube)) {
|
|
||||||
return; // from lambda
|
|
||||||
}
|
|
||||||
_queryAACube += descendantAACube.getMinimumPoint();
|
|
||||||
_queryAACube += descendantAACube.getMaximumPoint();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
_queryAACubeSet = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldPuffQueryAACube()) {
|
||||||
|
// make an expanded AACube centered on the object
|
||||||
|
float scale = PARENTED_EXPANSION_FACTOR * maxAACube.getScale();
|
||||||
|
_queryAACube = AACube(maxAACube.calcCenter() - glm::vec3(0.5f * scale), scale);
|
||||||
|
_queryAACubeIsPuffed = true;
|
||||||
|
} else {
|
||||||
|
_queryAACube = maxAACube;
|
||||||
|
_queryAACubeIsPuffed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
forEachDescendant([&](const SpatiallyNestablePointer& descendant) {
|
||||||
|
bool childSuccess;
|
||||||
|
AACube descendantAACube = descendant->getQueryAACube(childSuccess);
|
||||||
|
if (childSuccess) {
|
||||||
|
if (_queryAACube.contains(descendantAACube)) {
|
||||||
|
return; // from lambda
|
||||||
|
}
|
||||||
|
_queryAACube += descendantAACube.getMinimumPoint();
|
||||||
|
_queryAACube += descendantAACube.getMaximumPoint();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_queryAACubeSet = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue