add diff traversal reset when resetting state

This commit is contained in:
Stephen Birarda 2017-11-17 09:44:35 -08:00
parent eedb77dae9
commit dd27e3db31
3 changed files with 6 additions and 3 deletions

View file

@ -26,13 +26,14 @@ EntityTreeSendThread::EntityTreeSendThread(OctreeServer* myServer, const SharedN
// connect to connection ID change on EntityNodeData so we can clear state for this receiver
auto nodeData = static_cast<EntityNodeData*>(node->getLinkedData());
connect(nodeData, &EntityNodeData::incomingConnectionIDChanged, this, &EntityTreeSendThread::resetKnownState);
connect(nodeData, &EntityNodeData::incomingConnectionIDChanged, this, &EntityTreeSendThread::resetState);
}
void EntityTreeSendThread::resetKnownState() {
void EntityTreeSendThread::resetState() {
qCDebug(entities) << "Clearing known EntityTreeSendThread state for" << _nodeUuid;
_knownState.clear();
_traversal.reset();
}
void EntityTreeSendThread::preDistributionProcessing() {

View file

@ -34,7 +34,7 @@ protected:
bool viewFrustumChanged, bool isFullScene) override;
private slots:
void resetKnownState(); // clears our known state forcing entities to appear unsent
void resetState(); // clears our known state forcing entities to appear unsent
private:
// the following two methods return booleans to indicate if any extra flagged entities were new additions to set

View file

@ -73,6 +73,8 @@ public:
void setScanCallback(std::function<void (VisibleElement&)> cb);
void traverse(uint64_t timeBudget);
void reset() { _path.clear(); _completedView.startTime = 0; } // resets our state to force a new "First" traversal
private:
void getNextVisibleElement(VisibleElement& next);