Move updateTextureFiltering and material into the base class

This commit is contained in:
scrawl 2017-03-07 17:22:47 +01:00
parent 5eff286c71
commit c487df0abb
4 changed files with 14 additions and 15 deletions

View file

@ -1,6 +1,8 @@
#include "world.hpp"
#include <osg/Group>
#include <osg/Material>
#include <osgUtil/IncrementalCompileOperation>
#include <components/resource/resourcesystem.hpp>
@ -23,6 +25,10 @@ World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSyst
mTerrainRoot = new osg::Group;
mTerrainRoot->setNodeMask(nodeMask);
mTerrainRoot->getOrCreateStateSet()->setRenderingHint(osg::StateSet::OPAQUE_BIN);
osg::ref_ptr<osg::Material> material (new osg::Material);
material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
mTerrainRoot->getOrCreateStateSet()->setAttributeAndModes(material, osg::StateAttribute::ON);
mTerrainRoot->setName("Terrain Root");
osg::ref_ptr<CompositeMapRenderer> renderer (new CompositeMapRenderer);
@ -55,4 +61,9 @@ float World::getHeightAt(const osg::Vec3f &worldPos)
return mStorage->getHeightAt(worldPos);
}
void World::updateTextureFiltering()
{
mTextureManager->updateTextureFiltering();
}
}