mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 16:49:54 +00:00
bounds fix
This commit is contained in:
parent
cb72e812f9
commit
f45c650975
1 changed files with 7 additions and 3 deletions
|
@ -98,6 +98,13 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
if (ptr.getTypeName().find("Door") != std::string::npos)
|
if (ptr.getTypeName().find("Door") != std::string::npos)
|
||||||
small = false;
|
small = false;
|
||||||
|
|
||||||
|
if (mBounds.find(ptr.getCell()) == mBounds.end())
|
||||||
|
mBounds[ptr.getCell()] = Ogre::AxisAlignedBox::BOX_NULL;
|
||||||
|
|
||||||
|
Ogre::AxisAlignedBox bounds = ent->getBoundingBox();
|
||||||
|
bounds.scale(insert->getScale());
|
||||||
|
mBounds[ptr.getCell()].merge(bounds);
|
||||||
|
|
||||||
if(!mIsStatic)
|
if(!mIsStatic)
|
||||||
{
|
{
|
||||||
insert->attachObject(ent);
|
insert->attachObject(ent);
|
||||||
|
@ -142,10 +149,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||||
// - there will be too many batches.
|
// - there will be too many batches.
|
||||||
sg->setRegionDimensions(Ogre::Vector3(2500,2500,2500));
|
sg->setRegionDimensions(Ogre::Vector3(2500,2500,2500));
|
||||||
|
|
||||||
mBounds[ptr.getCell()].merge(ent->getBoundingBox());
|
|
||||||
|
|
||||||
sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale());
|
sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale());
|
||||||
mBounds[ptr.getCell()].merge(insert->_getDerivedPosition());
|
|
||||||
|
|
||||||
mRenderer.getScene()->destroyEntity(ent);
|
mRenderer.getScene()->destroyEntity(ent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue