mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 07:33:10 +02:00
Merge pull request #14740 from AndrewMeadows/fix-case-20731
Case 20731: send updates when grabbing AvatarEntities
This commit is contained in:
commit
4050e4d998
2 changed files with 9 additions and 5 deletions
|
@ -873,9 +873,13 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
||||||
collisionlessAllowed = zone->getGhostingAllowed();
|
collisionlessAllowed = zone->getGhostingAllowed();
|
||||||
}
|
}
|
||||||
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
||||||
bool force = false;
|
|
||||||
bool iShouldTellServer = true;
|
|
||||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||||
|
// we need to update attached queryAACubes in our own local tree so point-select always works
|
||||||
|
// however we don't want to flood the update pipeline with AvatarEntity updates, so we assume
|
||||||
|
// others have all info required to properly update queryAACube of AvatarEntities on their end
|
||||||
|
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
||||||
|
bool iShouldTellServer = !(entity && entity->isAvatarEntity());
|
||||||
|
const bool force = false;
|
||||||
entityTree->updateEntityQueryAACube(object, packetSender, force, iShouldTellServer);
|
entityTree->updateEntityQueryAACube(object, packetSender, force, iShouldTellServer);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -3008,8 +3008,8 @@ void EntityTree::updateEntityQueryAACubeWorker(SpatiallyNestablePointer object,
|
||||||
// if the queryBox has changed, tell the entity-server
|
// if the queryBox has changed, tell the entity-server
|
||||||
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
||||||
if (entity) {
|
if (entity) {
|
||||||
bool tellServerThis = tellServer && (entity->getEntityHostType() != entity::HostType::AVATAR);
|
// NOTE: we rely on side-effects of the entity->updateQueryAACube() call in the following if() conditional:
|
||||||
if ((entity->updateQueryAACube() || force)) {
|
if (entity->updateQueryAACube() || force) {
|
||||||
bool success;
|
bool success;
|
||||||
AACube newCube = entity->getQueryAACube(success);
|
AACube newCube = entity->getQueryAACube(success);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
@ -3017,7 +3017,7 @@ void EntityTree::updateEntityQueryAACubeWorker(SpatiallyNestablePointer object,
|
||||||
}
|
}
|
||||||
// send an edit packet to update the entity-server about the queryAABox. We do this for domain-hosted
|
// send an edit packet to update the entity-server about the queryAABox. We do this for domain-hosted
|
||||||
// entities as well as for avatar-entities; the packet-sender will route the update accordingly
|
// entities as well as for avatar-entities; the packet-sender will route the update accordingly
|
||||||
if (tellServerThis && packetSender && (entity->isDomainEntity() || entity->isAvatarEntity())) {
|
if (tellServer && packetSender && (entity->isDomainEntity() || entity->isAvatarEntity())) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
EntityItemProperties properties = entity->getProperties();
|
EntityItemProperties properties = entity->getProperties();
|
||||||
properties.setQueryAACubeDirty();
|
properties.setQueryAACubeDirty();
|
||||||
|
|
Loading…
Reference in a new issue