You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/components/terrain/world.cpp

38 lines
815 B
C++

#include "world.hpp"
10 years ago
#include <osg/Group>
#include <osgUtil/IncrementalCompileOperation>
#include "storage.hpp"
namespace Terrain
{
10 years ago
World::World(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico,
Storage* storage, int nodeMask)
: mStorage(storage)
, mParent(parent)
, mResourceSystem(resourceSystem)
, mIncrementalCompileOperation(ico)
{
10 years ago
mTerrainRoot = new osg::Group;
mTerrainRoot->setNodeMask(nodeMask);
mTerrainRoot->getOrCreateStateSet()->setRenderingHint(osg::StateSet::OPAQUE_BIN);
mParent->addChild(mTerrainRoot);
}
World::~World()
{
10 years ago
mParent->removeChild(mTerrainRoot);
delete mStorage;
}
10 years ago
float World::getHeightAt(const osg::Vec3f &worldPos)
{
return mStorage->getHeightAt(worldPos);
}
}