Merge pull request #14857 from Atlante45/fix/ess-parenting

Case 15420: Fix ESS sometimes not getting the parents/children of entities with scripts.
This commit is contained in:
Andrew Meadows 2019-02-13 17:26:57 -08:00 committed by GitHub
commit 72b5fa1968
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 17 deletions

View file

@ -111,7 +111,7 @@ bool EntityTreeSendThread::traverseTreeAndSendContents(SharedNodePointer node, O
int32_t lodLevelOffset = nodeData->getBoundaryLevelAdjust() + (viewFrustumChanged ? LOW_RES_MOVING_ADJUST : NO_BOUNDARY_ADJUST);
newView.lodScaleFactor = powf(2.0f, lodLevelOffset);
startNewTraversal(newView, root);
startNewTraversal(newView, root, isFullScene);
// When the viewFrustum changed the sort order may be incorrect, so we re-sort
// and also use the opportunity to cull anything no longer in view
@ -220,9 +220,10 @@ bool EntityTreeSendThread::addDescendantsToExtraFlaggedEntities(const QUuid& fil
return hasNewChild || hasNewDescendants;
}
void EntityTreeSendThread::startNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root) {
void EntityTreeSendThread::startNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root,
bool forceFirstPass) {
DiffTraversal::Type type = _traversal.prepareNewTraversal(view, root);
DiffTraversal::Type type = _traversal.prepareNewTraversal(view, root, forceFirstPass);
// there are three types of traversal:
//
// (1) FirstTime = at login --> find everything in view

View file

@ -42,7 +42,7 @@ private:
bool addAncestorsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
bool addDescendantsToExtraFlaggedEntities(const QUuid& filteredEntityID, EntityItem& entityItem, EntityNodeData& nodeData);
void startNewTraversal(const DiffTraversal::View& viewFrustum, EntityTreeElementPointer root);
void startNewTraversal(const DiffTraversal::View& viewFrustum, EntityTreeElementPointer root, bool forceFirstPass = false);
bool traverseTreeAndBuildNextPacketPayload(EncodeBitstreamParams& params, const QJsonObject& jsonFilters) override;
void preDistributionProcessing() override;

View file

@ -193,7 +193,8 @@ DiffTraversal::DiffTraversal() {
_path.reserve(MIN_PATH_DEPTH);
}
DiffTraversal::Type DiffTraversal::prepareNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root) {
DiffTraversal::Type DiffTraversal::prepareNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root,
bool forceFirstPass) {
assert(root);
// there are three types of traversal:
//
@ -212,7 +213,7 @@ DiffTraversal::Type DiffTraversal::prepareNewTraversal(const DiffTraversal::View
Type type;
// If usesViewFrustum changes, treat it as a First traversal
if (_completedView.startTime == 0 || _currentView.usesViewFrustums() != _completedView.usesViewFrustums()) {
if (forceFirstPass || _completedView.startTime == 0 || _currentView.usesViewFrustums() != _completedView.usesViewFrustums()) {
type = Type::First;
_currentView.viewFrustums = view.viewFrustums;
_currentView.lodScaleFactor = view.lodScaleFactor;

View file

@ -61,7 +61,7 @@ public:
DiffTraversal();
Type prepareNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root);
Type prepareNewTraversal(const DiffTraversal::View& view, EntityTreeElementPointer root, bool forceFirstPass = false);
const View& getCurrentView() const { return _currentView; }

View file

@ -2640,15 +2640,8 @@ bool EntityItem::matchesJSONFilters(const QJsonObject& jsonFilters) const {
static const QString SERVER_SCRIPTS_PROPERTY = "serverScripts";
foreach(const auto& property, jsonFilters.keys()) {
if (property == SERVER_SCRIPTS_PROPERTY && jsonFilters[property] == EntityQueryFilterSymbol::NonDefault) {
// check if this entity has a non-default value for serverScripts
if (_serverScripts != ENTITY_ITEM_DEFAULT_SERVER_SCRIPTS) {
return true;
} else {
return false;
}
}
if (jsonFilters[SERVER_SCRIPTS_PROPERTY] == EntityQueryFilterSymbol::NonDefault) {
return _serverScripts != ENTITY_ITEM_DEFAULT_SERVER_SCRIPTS;
}
// the json filter syntax did not match what we expected, return a match

View file

@ -533,7 +533,6 @@ void NetworkTexture::makeRequest() {
} else {
qWarning(networking) << "NetworkTexture::makeRequest() called while not in a valid state: " << _ktxResourceState;
}
}
void NetworkTexture::handleLocalRequestCompleted() {