mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
better solution
This commit is contained in:
parent
eef2f656be
commit
bed2ea052d
2 changed files with 3 additions and 17 deletions
|
@ -65,7 +65,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
EntityTree::EntityTree(bool shouldReaverage) :
|
EntityTree::EntityTree(bool shouldReaverage) :
|
||||||
Octree(shouldReaverage)
|
Octree(shouldReaverage), _needsParentFixupLock(QReadWriteLock::Recursive)
|
||||||
{
|
{
|
||||||
resetClientEditStats();
|
resetClientEditStats();
|
||||||
|
|
||||||
|
@ -1679,23 +1679,13 @@ void EntityTree::entityChanged(EntityItemPointer entity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<EntityItemWeakPointer> EntityTree::getEntitiesParentFixup() const {
|
|
||||||
QReadLocker locker(&_needsParentFixupLock);
|
|
||||||
return _needsParentFixup;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityTree::setNeedsParentFixup(QVector<EntityItemWeakPointer> entitiesFixup) {
|
|
||||||
QWriteLocker locker(&_needsParentFixupLock);
|
|
||||||
_needsParentFixup = entitiesFixup;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityTree::fixupNeedsParentFixups() {
|
void EntityTree::fixupNeedsParentFixups() {
|
||||||
PROFILE_RANGE(simulation_physics, "FixupParents");
|
PROFILE_RANGE(simulation_physics, "FixupParents");
|
||||||
MovingEntitiesOperator moveOperator;
|
MovingEntitiesOperator moveOperator;
|
||||||
|
|
||||||
QVector<EntityItemWeakPointer> entitiesParentFixup = getEntitiesParentFixup();
|
QWriteLocker locker(&_needsParentFixupLock);
|
||||||
|
|
||||||
QMutableVectorIterator<EntityItemWeakPointer> iter(entitiesParentFixup);
|
QMutableVectorIterator<EntityItemWeakPointer> iter(_needsParentFixup);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
EntityItemWeakPointer entityWP = iter.next();
|
EntityItemWeakPointer entityWP = iter.next();
|
||||||
EntityItemPointer entity = entityWP.lock();
|
EntityItemPointer entity = entityWP.lock();
|
||||||
|
@ -1758,8 +1748,6 @@ void EntityTree::fixupNeedsParentFixups() {
|
||||||
PerformanceTimer perfTimer("recurseTreeWithOperator");
|
PerformanceTimer perfTimer("recurseTreeWithOperator");
|
||||||
recurseTreeWithOperator(&moveOperator);
|
recurseTreeWithOperator(&moveOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
setNeedsParentFixup(entitiesParentFixup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) {
|
void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) {
|
||||||
|
|
|
@ -385,8 +385,6 @@ private:
|
||||||
void sendChallengeOwnershipPacket(const QString& certID, const QString& ownerKey, const EntityItemID& entityItemID, const SharedNodePointer& senderNode);
|
void sendChallengeOwnershipPacket(const QString& certID, const QString& ownerKey, const EntityItemID& entityItemID, const SharedNodePointer& senderNode);
|
||||||
void sendChallengeOwnershipRequestPacket(const QByteArray& certID, const QByteArray& text, const QByteArray& nodeToChallenge, const SharedNodePointer& senderNode);
|
void sendChallengeOwnershipRequestPacket(const QByteArray& certID, const QByteArray& text, const QByteArray& nodeToChallenge, const SharedNodePointer& senderNode);
|
||||||
void validatePop(const QString& certID, const EntityItemID& entityItemID, const SharedNodePointer& senderNode, bool isRetryingValidation);
|
void validatePop(const QString& certID, const EntityItemID& entityItemID, const SharedNodePointer& senderNode, bool isRetryingValidation);
|
||||||
QVector<EntityItemWeakPointer> getEntitiesParentFixup() const;
|
|
||||||
void setNeedsParentFixup(QVector<EntityItemWeakPointer> entitiesFixup);
|
|
||||||
|
|
||||||
std::shared_ptr<AvatarData> _myAvatar{ nullptr };
|
std::shared_ptr<AvatarData> _myAvatar{ nullptr };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue