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.hpp

70 lines
1.6 KiB
C++

#ifndef COMPONENTS_TERRAIN_WORLD_H
#define COMPONENTS_TERRAIN_WORLD_H
10 years ago
#include <osg/ref_ptr>
#include "defs.hpp"
#include "buffercache.hpp"
10 years ago
namespace osg
{
10 years ago
class Group;
}
namespace osgUtil
{
class IncrementalCompileOperation;
}
namespace Resource
{
class ResourceSystem;
}
namespace Terrain
{
class Storage;
/**
* @brief The basic interface for a terrain world. How the terrain chunks are paged and displayed
* is up to the implementation.
*/
class World
{
public:
/// @note takes ownership of \a storage
/// @param storage Storage instance to get terrain data from (heights, normals, colors, textures..)
10 years ago
/// @param nodeMask mask for the terrain root
World(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico,
Storage* storage, int nodeMask);
virtual ~World();
virtual void updateTextureFiltering() {}
9 years ago
virtual void updateCache() {}
10 years ago
float getHeightAt (const osg::Vec3f& worldPos);
9 years ago
virtual osg::ref_ptr<osg::Node> cacheCell(int x, int y) {return NULL;}
// This is only a hint and may be ignored by the implementation.
virtual void loadCell(int x, int y) {}
virtual void unloadCell(int x, int y) {}
Storage* getStorage() { return mStorage; }
protected:
Storage* mStorage;
10 years ago
osg::ref_ptr<osg::Group> mParent;
osg::ref_ptr<osg::Group> mTerrainRoot;
Resource::ResourceSystem* mResourceSystem;
10 years ago
osg::ref_ptr<osgUtil::IncrementalCompileOperation> mIncrementalCompileOperation;
};
}
#endif