include queryAABox in physics-induced sends

This commit is contained in:
Seth Alves 2015-12-16 17:25:49 -08:00
parent 0500c21e00
commit b83579e6e5
3 changed files with 7 additions and 2 deletions

View file

@ -93,6 +93,7 @@ void AvatarData::nextAttitude(glm::vec3 position, glm::quat orientation) {
bool success; bool success;
Transform trans = getTransform(success); Transform trans = getTransform(success);
if (!success) { if (!success) {
qDebug() << "Warning -- AvatarData::nextAttitude failed";
return; return;
} }
trans.setTranslation(position); trans.setTranslation(position);

View file

@ -211,8 +211,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
bool updatedEntity = false; bool updatedEntity = false;
_entityTree->withWriteLock([&] { _entityTree->withWriteLock([&] {
if (scriptSideProperties.parentDependentPropertyChanged() || if (scriptSideProperties.parentRelatedPropertyChanged()) {
scriptSideProperties.parentIDChanged() || scriptSideProperties.parentJointIndexChanged()) {
// All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them. // 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. // If any of these changed, pull any missing properties from the entity.
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);

View file

@ -466,6 +466,11 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
properties.setActionData(_serverActionData); 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 // set the LastEdited of the properties but NOT the entity itself
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
properties.setLastEdited(now); properties.setLastEdited(now);