History

Merge pull request #11009 from AndrewMeadows/fix-QueryAACube

update EntityItem bounding cube when on changed dimensions

Brad Hefta-Gaub committed 9 years ago

Commit d5725102 parents 9b3be6d 6b3860010 files · +86 −75Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 10 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+3−3
@@ -221,7 +221,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 220 unmodified lines
221 _entityTree->withWriteLock([&] {221 _entityTree->withWriteLock([&] {
222 EntityItemPointer entity = _entityTree->addEntity(id, propertiesWithSimID);222 EntityItemPointer entity = _entityTree->addEntity(id, propertiesWithSimID);
223 if (entity) {223 if (entity) {
224 if (propertiesWithSimID.parentRelatedPropertyChanged()) {224 if (propertiesWithSimID.queryAACubeRelatedPropertyChanged()) {
225 // due to parenting, the server may not know where something is in world-space, so include the bounding cube.225 // due to parenting, the server may not know where something is in world-space, so include the bounding cube.
226 bool success;226 bool success;
227 AACube queryAACube = entity->getQueryAACube(success);227 AACube queryAACube = entity->getQueryAACube(success);
@@ -435,7 +435,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 207 unmodified lines
435 entity->rememberHasSimulationOwnershipBid();435 entity->rememberHasSimulationOwnershipBid();
436 }436 }
437 }437 }
438 if (properties.parentRelatedPropertyChanged() && entity->computePuffedQueryAACube()) {438 if (properties.queryAACubeRelatedPropertyChanged()) {
439 properties.setQueryAACube(entity->getQueryAACube());439 properties.setQueryAACube(entity->getQueryAACube());
440 }440 }
441 entity->setLastBroadcast(usecTimestampNow());441 entity->setLastBroadcast(usecTimestampNow());
@@ -445,7 +445,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 3 unmodified lines
445 // if they've changed.445 // if they've changed.
446 entity->forEachDescendant([&](SpatiallyNestablePointer descendant) {446 entity->forEachDescendant([&](SpatiallyNestablePointer descendant) {
447 if (descendant->getNestableType() == NestableType::Entity) {447 if (descendant->getNestableType() == NestableType::Entity) {
448 if (descendant->computePuffedQueryAACube()) {448 if (descendant->checkAndMaybeUpdateQueryAACube()) {
449 EntityItemPointer entityDescendant = std::static_pointer_cast<EntityItem>(descendant);449 EntityItemPointer entityDescendant = std::static_pointer_cast<EntityItem>(descendant);
450 EntityItemProperties newQueryCubeProperties;450 EntityItemProperties newQueryCubeProperties;
451 newQueryCubeProperties.setQueryAACube(descendant->getQueryAACube());451 newQueryCubeProperties.setQueryAACube(descendant->getQueryAACube());