try harder to put things in place when their parent entities are discovered

This commit is contained in:
Seth Alves 2017-05-18 14:35:39 -07:00
parent ef556fae9b
commit 1b0eeb9c2c

View file

@ -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<EntityItem>(object);
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
}
});
locationChanged();
}
}