forked from teamnwah/openmw-tes3coop
Set node mask to cell borders
This commit is contained in:
parent
414e6caafe
commit
ab8de9fa14
3 changed files with 8 additions and 4 deletions
|
@ -10,9 +10,10 @@
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
|
||||||
CellBorder::CellBorder(Terrain::World *world, osg::Group *root):
|
CellBorder::CellBorder(Terrain::World *world, osg::Group *root, int borderMask):
|
||||||
mWorld(world),
|
mWorld(world),
|
||||||
mRoot(root)
|
mRoot(root),
|
||||||
|
mBorderMask(borderMask)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +69,8 @@ void CellBorder::createCellBorderGeometry(int x, int y)
|
||||||
polygonmode->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);
|
polygonmode->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);
|
||||||
stateSet->setAttributeAndModes(polygonmode,osg::StateAttribute::ON);
|
stateSet->setAttributeAndModes(polygonmode,osg::StateAttribute::ON);
|
||||||
|
|
||||||
|
borderGeode->setNodeMask(mBorderMask);
|
||||||
|
|
||||||
mRoot->addChild(borderGeode);
|
mRoot->addChild(borderGeode);
|
||||||
|
|
||||||
mCellBorderNodes[std::make_pair(x,y)] = borderGeode;
|
mCellBorderNodes[std::make_pair(x,y)] = borderGeode;
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace MWRender
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node> > CellGrid;
|
typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node> > CellGrid;
|
||||||
|
|
||||||
CellBorder(Terrain::World *world, osg::Group *root);
|
CellBorder(Terrain::World *world, osg::Group *root, int borderMask);
|
||||||
|
|
||||||
void createCellBorderGeometry(int x, int y);
|
void createCellBorderGeometry(int x, int y);
|
||||||
void destroyCellBorderGeometry(int x, int y);
|
void destroyCellBorderGeometry(int x, int y);
|
||||||
|
@ -34,6 +34,7 @@ namespace MWRender
|
||||||
osg::Group *mRoot;
|
osg::Group *mRoot;
|
||||||
|
|
||||||
CellGrid mCellBorderNodes;
|
CellGrid mCellBorderNodes;
|
||||||
|
int mBorderMask;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSyst
|
||||||
|
|
||||||
mTextureManager.reset(new TextureManager(mResourceSystem->getSceneManager()));
|
mTextureManager.reset(new TextureManager(mResourceSystem->getSceneManager()));
|
||||||
mChunkManager.reset(new ChunkManager(mStorage, mResourceSystem->getSceneManager(), mTextureManager.get(), mCompositeMapRenderer));
|
mChunkManager.reset(new ChunkManager(mStorage, mResourceSystem->getSceneManager(), mTextureManager.get(), mCompositeMapRenderer));
|
||||||
mCellBorder.reset(new MWRender::CellBorder(this,mTerrainRoot.get()));
|
mCellBorder.reset(new MWRender::CellBorder(this,mTerrainRoot.get(),borderMask));
|
||||||
|
|
||||||
mResourceSystem->addResourceManager(mChunkManager.get());
|
mResourceSystem->addResourceManager(mChunkManager.get());
|
||||||
mResourceSystem->addResourceManager(mTextureManager.get());
|
mResourceSystem->addResourceManager(mTextureManager.get());
|
||||||
|
|
Loading…
Reference in a new issue