mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 09:23:54 +00:00
Use the correct offset when building static geometry from an entity
This commit is contained in:
parent
23ac1c2de5
commit
7f2d71554e
1 changed files with 7 additions and 5 deletions
|
@ -193,13 +193,15 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
|
|
||||||
sg->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
sg->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
||||||
|
|
||||||
for(size_t i = 0;i < entities.mEntities.size();i++)
|
std::vector<Ogre::Entity*>::reverse_iterator iter = entities.mEntities.rbegin();
|
||||||
|
while(iter != entities.mEntities.rend())
|
||||||
{
|
{
|
||||||
Ogre::Entity *ent = entities.mEntities[i];
|
Ogre::Node *node = (*iter)->getParentNode();
|
||||||
insert->detachObject(ent);
|
sg->addEntity(*iter, node->_getDerivedPosition(), node->_getDerivedOrientation(), node->_getDerivedScale());
|
||||||
sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale());
|
|
||||||
|
|
||||||
mRenderer.getScene()->destroyEntity(ent);
|
(*iter)->detachFromParent();
|
||||||
|
mRenderer.getScene()->destroyEntity(*iter);
|
||||||
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue