mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
when a parent moves, check children vs their queryAACubes
This commit is contained in:
parent
7689453ba2
commit
3782c21b45
1 changed files with 14 additions and 0 deletions
|
@ -296,6 +296,8 @@ void SpatiallyNestable::setPosition(const glm::vec3& position, bool& success) {
|
|||
});
|
||||
if (success) {
|
||||
locationChanged();
|
||||
} else {
|
||||
qDebug() << "setPosition failed for" << getID();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -554,6 +556,18 @@ bool SpatiallyNestable::queryAABoxNeedsUpdate() const {
|
|||
qDebug() << "can't getMaximumAACube for" << getID();
|
||||
return false;
|
||||
}
|
||||
|
||||
// make sure children are still in their boxes, also.
|
||||
bool childNeedsUpdate = false;
|
||||
getThisPointer()->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
if (descendant->queryAABoxNeedsUpdate()) {
|
||||
childNeedsUpdate = true;
|
||||
}
|
||||
});
|
||||
if (childNeedsUpdate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_queryAACubeSet && _queryAACube.contains(currentAACube)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue