when a ModelEntityItem moves, also update its meta-render-item

This commit is contained in:
Seth Alves 2016-05-12 18:05:28 -07:00
parent 85272a87ba
commit dd2a29aace

View file

@ -807,6 +807,16 @@ void RenderableModelEntityItem::locationChanged(bool tellPhysics) {
if (_model && _model->isActive()) {
_model->setRotation(getRotation());
_model->setTranslation(getPosition());
auto myMetaItemCopy = _myMetaItem;
void* key = (void*)this;
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [_myMetaItem]() {
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
render::PendingChanges pendingChanges;
pendingChanges.updateItem<RenderableModelEntityItemMeta>(myMetaItemCopy, [](RenderableModelEntityItemMeta& data){});
scene->enqueuePendingChanges(pendingChanges);
});
}
}