mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
try again to fix update logic
This commit is contained in:
parent
ce3faa2916
commit
63073301ee
1 changed files with 9 additions and 10 deletions
|
@ -42,6 +42,9 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTreePointer tree,
|
|||
_oldEntityCube = _existingEntity->getQueryAACube();
|
||||
_oldEntityBox = _oldEntityCube.clamp((float)-HALF_TREE_SCALE, (float)HALF_TREE_SCALE); // clamp to domain bounds
|
||||
|
||||
_newEntityCube = newQueryAACube;
|
||||
_newEntityBox = _newEntityCube.clamp((float)-HALF_TREE_SCALE, (float)HALF_TREE_SCALE); // clamp to domain bounds
|
||||
|
||||
// If our new properties don't have bounds details (no change to position, etc) or if this containing element would
|
||||
// be the best fit for our new properties, then just do the new portion of the store pass, since the change path will
|
||||
// be the same for both parts of the update
|
||||
|
@ -49,23 +52,19 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTreePointer tree,
|
|||
|
||||
// For some reason we've seen a case where the original containing element isn't a best fit for the old properties
|
||||
// in this case we want to move it, even if the properties haven't changed.
|
||||
if (!oldElementBestFit) {
|
||||
if (oldElementBestFit) {
|
||||
if (_wantDebug) {
|
||||
qCDebug(entities) << " **** TYPICAL NO MOVE CASE **** oldElementBestFit:" << oldElementBestFit;
|
||||
}
|
||||
} else {
|
||||
_oldEntityBox = _existingEntity->getElement()->getAACube();
|
||||
_removeOld = true; // our properties are going to move us, so remember this for later processing
|
||||
|
||||
if (_wantDebug) {
|
||||
qCDebug(entities) << " **** UNUSUAL CASE **** no changes, but not best fit... consider it a move.... **";
|
||||
}
|
||||
} else {
|
||||
_foundOld = true;
|
||||
|
||||
if (_wantDebug) {
|
||||
qCDebug(entities) << " **** TYPICAL NO MOVE CASE **** oldElementBestFit:" << oldElementBestFit;
|
||||
}
|
||||
}
|
||||
|
||||
_newEntityCube = newQueryAACube;
|
||||
_newEntityBox = _newEntityCube.clamp((float)-HALF_TREE_SCALE, (float)HALF_TREE_SCALE); // clamp to domain bounds
|
||||
|
||||
if (_wantDebug) {
|
||||
qCDebug(entities) << " _entityItemID:" << _entityItemID;
|
||||
qCDebug(entities) << " _containingElementCube:" << _containingElementCube;
|
||||
|
|
Loading…
Reference in a new issue