From 1b0eeb9c2c8cc01a1e87a343cb205451fc0f383d Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 18 May 2017 14:35:39 -0700 Subject: [PATCH] try harder to put things in place when their parent entities are discovered --- libraries/entities/src/EntityItem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 43ba881432..7f7c8b63cb 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -1616,6 +1616,7 @@ void EntityItem::updatePosition(const glm::vec3& value) { entity->markDirtyFlags(Simulation::DIRTY_POSITION); } }); + locationChanged(); } } @@ -1625,6 +1626,13 @@ void EntityItem::updateParentID(const QUuid& value) { // children are forced to be kinematic // may need to not collide with own avatar markDirtyFlags(Simulation::DIRTY_MOTION_TYPE | Simulation::DIRTY_COLLISION_GROUP | Simulation::DIRTY_POSITION); + forEachDescendant([&](SpatiallyNestablePointer object) { + if (object->getNestableType() == NestableType::Entity) { + EntityItemPointer entity = std::static_pointer_cast(object); + entity->markDirtyFlags(Simulation::DIRTY_POSITION); + } + }); + locationChanged(); } }