|
|
|
@ -131,7 +131,6 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
|
|
|
|
|
|
|
|
|
if(!mIsStatic || !Settings::Manager::getBool("use static geometry", "Objects"))
|
|
|
|
|
{
|
|
|
|
@ -139,12 +138,24 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
|
|
|
|
|
ent->setRenderingDistance(small ? Settings::Manager::getInt("small object distance", "Viewing distance") : 0);
|
|
|
|
|
ent->setVisibilityFlags(mIsStatic ? (small ? RV_StaticsSmall : RV_Statics) : RV_Misc);
|
|
|
|
|
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Ogre::StaticGeometry* sg = 0;
|
|
|
|
|
|
|
|
|
|
if (small)
|
|
|
|
|
if (transparent)
|
|
|
|
|
{
|
|
|
|
|
if( mStaticGeometryAlpha.find(ptr.getCell()) == mStaticGeometryAlpha.end())
|
|
|
|
|
{
|
|
|
|
|
uniqueID = uniqueID +1;
|
|
|
|
|
sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
|
|
|
|
mStaticGeometryAlpha[ptr.getCell()] = sg;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
sg = mStaticGeometryAlpha[ptr.getCell()];
|
|
|
|
|
}
|
|
|
|
|
else if (small)
|
|
|
|
|
{
|
|
|
|
|
if( mStaticGeometrySmall.find(ptr.getCell()) == mStaticGeometrySmall.end())
|
|
|
|
|
{
|
|
|
|
@ -152,7 +163,7 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
|
|
|
|
|
mStaticGeometrySmall[ptr.getCell()] = sg;
|
|
|
|
|
|
|
|
|
|
sg->setRenderingDistance(Settings::Manager::getInt("small object distance", "Viewing distance")); /// \todo config value
|
|
|
|
|
sg->setRenderingDistance(Settings::Manager::getInt("small object distance", "Viewing distance"));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
sg = mStaticGeometrySmall[ptr.getCell()];
|
|
|
|
@ -182,6 +193,8 @@ void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
|
|
|
|
|
|
|
|
|
sg->setVisibilityFlags(small ? RV_StaticsSmall : RV_Statics);
|
|
|
|
|
|
|
|
|
|
sg->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
|
|
|
|
|
|
|
|
|
|
mRenderer.getScene()->destroyEntity(ent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -275,6 +288,13 @@ void Objects::removeCell(MWWorld::Ptr::CellStore* store)
|
|
|
|
|
mRenderer.getScene()->destroyStaticGeometry (sg);
|
|
|
|
|
sg = 0;
|
|
|
|
|
}
|
|
|
|
|
if(mStaticGeometryAlpha.find(store) != mStaticGeometryAlpha.end())
|
|
|
|
|
{
|
|
|
|
|
Ogre::StaticGeometry* sg = mStaticGeometryAlpha[store];
|
|
|
|
|
mStaticGeometryAlpha.erase(store);
|
|
|
|
|
mRenderer.getScene()->destroyStaticGeometry (sg);
|
|
|
|
|
sg = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(mBounds.find(store) != mBounds.end())
|
|
|
|
|
mBounds.erase(store);
|
|
|
|
@ -292,6 +312,11 @@ void Objects::buildStaticGeometry(ESMS::CellStore<MWWorld::RefData>& cell)
|
|
|
|
|
Ogre::StaticGeometry* sg = mStaticGeometrySmall[&cell];
|
|
|
|
|
sg->build();
|
|
|
|
|
}
|
|
|
|
|
if(mStaticGeometryAlpha.find(&cell) != mStaticGeometryAlpha.end())
|
|
|
|
|
{
|
|
|
|
|
Ogre::StaticGeometry* sg = mStaticGeometryAlpha[&cell];
|
|
|
|
|
sg->build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ogre::AxisAlignedBox Objects::getDimensions(MWWorld::Ptr::CellStore* cell)
|
|
|
|
|