From b83579e6e5426924c946abeaa7e204d1de6b9402 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 16 Dec 2015 17:25:49 -0800 Subject: [PATCH] include queryAABox in physics-induced sends --- libraries/avatars/src/AvatarData.cpp | 1 + libraries/entities/src/EntityScriptingInterface.cpp | 3 +-- libraries/physics/src/EntityMotionState.cpp | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index ecf9947979..8942699070 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -93,6 +93,7 @@ void AvatarData::nextAttitude(glm::vec3 position, glm::quat orientation) { bool success; Transform trans = getTransform(success); if (!success) { + qDebug() << "Warning -- AvatarData::nextAttitude failed"; return; } trans.setTranslation(position); diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 896d05b5ff..05fd481761 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -211,8 +211,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& bool updatedEntity = false; _entityTree->withWriteLock([&] { - if (scriptSideProperties.parentDependentPropertyChanged() || - scriptSideProperties.parentIDChanged() || scriptSideProperties.parentJointIndexChanged()) { + if (scriptSideProperties.parentRelatedPropertyChanged()) { // All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them. // If any of these changed, pull any missing properties from the entity. EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index f86369a514..2e23c4ebd8 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -466,6 +466,11 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q properties.setActionData(_serverActionData); } + if (properties.parentRelatedPropertyChanged()) { + // due to parenting, the server may not know where something is in world-space, so include the bounding cube. + properties.setQueryAACube(_entity->getQueryAACube()); + } + // set the LastEdited of the properties but NOT the entity itself quint64 now = usecTimestampNow(); properties.setLastEdited(now);