Set node mask to cell borders

pull/456/head
Miloslav Číž 7 years ago
parent 414e6caafe
commit ab8de9fa14

@ -10,9 +10,10 @@
namespace MWRender
{
CellBorder::CellBorder(Terrain::World *world, osg::Group *root):
CellBorder::CellBorder(Terrain::World *world, osg::Group *root, int borderMask):
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);
stateSet->setAttributeAndModes(polygonmode,osg::StateAttribute::ON);
borderGeode->setNodeMask(mBorderMask);
mRoot->addChild(borderGeode);
mCellBorderNodes[std::make_pair(x,y)] = borderGeode;

@ -19,7 +19,7 @@ namespace MWRender
public:
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 destroyCellBorderGeometry(int x, int y);
@ -34,6 +34,7 @@ namespace MWRender
osg::Group *mRoot;
CellGrid mCellBorderNodes;
int mBorderMask;
};
}

@ -47,7 +47,7 @@ World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSyst
mTextureManager.reset(new TextureManager(mResourceSystem->getSceneManager()));
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(mTextureManager.get());

Loading…
Cancel
Save