forked from teamnwah/openmw-tes3coop
static Objects goes inside the static geometry
This commit is contained in:
parent
cd79df1d8b
commit
4546ca3863
2 changed files with 15 additions and 7 deletions
|
@ -50,6 +50,8 @@ void ExteriorCellRender::insertBegin (ESM::CellRef &ref, bool static_)
|
||||||
{
|
{
|
||||||
assert (!mInsert);
|
assert (!mInsert);
|
||||||
|
|
||||||
|
isStatic = static_;
|
||||||
|
|
||||||
// Create and place scene node for this object
|
// Create and place scene node for this object
|
||||||
mInsert = mBase->createChildSceneNode();
|
mInsert = mBase->createChildSceneNode();
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ void ExteriorCellRender::insertBegin (ESM::CellRef &ref, bool static_)
|
||||||
// Rotates first around z, then y, then x
|
// Rotates first around z, then y, then x
|
||||||
mInsert->setOrientation(xr*yr*zr);
|
mInsert->setOrientation(xr*yr*zr);
|
||||||
|
|
||||||
mInsertMesh.clear();
|
mInsertMesh.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,13 +218,18 @@ void ExteriorCellRender::insertMesh(const std::string &mesh)
|
||||||
|
|
||||||
NIFLoader::load(mesh);
|
NIFLoader::load(mesh);
|
||||||
Entity *ent = mScene.getMgr()->createEntity(mesh);
|
Entity *ent = mScene.getMgr()->createEntity(mesh);
|
||||||
mInsert->attachObject(ent);
|
|
||||||
|
|
||||||
/*sg->addEntity(ent,mInsert->_getDerivedPosition(),mInsert->_getDerivedOrientation(),mInsert->_getDerivedScale());
|
if(!isStatic)
|
||||||
sg->setRegionDimensions(Ogre::Vector3(100000,10000,100000));*/
|
{
|
||||||
|
mInsert->attachObject(ent);
|
||||||
if (mInsertMesh.empty())
|
}
|
||||||
mInsertMesh = mesh;
|
else
|
||||||
|
{
|
||||||
|
sg->addEntity(ent,mInsert->_getDerivedPosition(),mInsert->_getDerivedOrientation(),mInsert->_getDerivedScale());
|
||||||
|
sg->setRegionDimensions(Ogre::Vector3(100000,10000,100000));
|
||||||
|
}
|
||||||
|
if (mInsertMesh.empty())
|
||||||
|
mInsertMesh = mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExteriorCellRender::insertObjectPhysics()
|
void ExteriorCellRender::insertObjectPhysics()
|
||||||
|
|
|
@ -59,6 +59,7 @@ namespace MWRender
|
||||||
|
|
||||||
//the static geometry
|
//the static geometry
|
||||||
Ogre::StaticGeometry *sg;
|
Ogre::StaticGeometry *sg;
|
||||||
|
bool isStatic;
|
||||||
|
|
||||||
// 0 normal, 1 more bright, 2 max
|
// 0 normal, 1 more bright, 2 max
|
||||||
int mAmbientMode;
|
int mAmbientMode;
|
||||||
|
|
Loading…
Reference in a new issue