mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 14:29:35 +02:00
only send queryAABox if something about the location changed
This commit is contained in:
parent
0ac06bad5c
commit
951db42146
3 changed files with 12 additions and 2 deletions
|
@ -1784,3 +1784,7 @@ QList<QString> EntityItemProperties::listChangedProperties() {
|
|||
bool EntityItemProperties::parentDependentPropertyChanged() const {
|
||||
return localPositionChanged() || positionChanged() || localRotationChanged() || rotationChanged();
|
||||
}
|
||||
|
||||
bool EntityItemProperties::parentRelatedPropertyChanged() const {
|
||||
return parentDependentPropertyChanged() || parentIDChanged() || parentJointIndexChanged();
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ public:
|
|||
EntityPropertyFlags getChangedProperties() const;
|
||||
|
||||
bool parentDependentPropertyChanged() const; // was there a changed in a property that requires parent info to interpret?
|
||||
bool parentRelatedPropertyChanged() const; // parentDependentPropertyChanged or parentID or parentJointIndex
|
||||
|
||||
AABox getAABox() const;
|
||||
|
||||
|
|
|
@ -134,7 +134,10 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
|||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
const QUuid myNodeID = nodeList->getSessionUUID();
|
||||
propertiesWithSimID.setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATION_PRIORITY);
|
||||
propertiesWithSimID.setQueryAACube(entity->getQueryAACube());
|
||||
if (propertiesWithSimID.parentRelatedPropertyChanged()) {
|
||||
// due to parenting, the server may not know where something is in world-space, so include the bounding cube.
|
||||
propertiesWithSimID.setQueryAACube(entity->getQueryAACube());
|
||||
}
|
||||
|
||||
// and make note of it now, so we can act on it right away.
|
||||
entity->setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATION_PRIORITY);
|
||||
|
@ -272,7 +275,9 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
|||
entity->flagForOwnership();
|
||||
}
|
||||
}
|
||||
properties.setQueryAACube(entity->getQueryAACube());
|
||||
if (properties.parentRelatedPropertyChanged()) {
|
||||
properties.setQueryAACube(entity->getQueryAACube());
|
||||
}
|
||||
entity->setLastBroadcast(usecTimestampNow());
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue