2018-06-12 23:48:31 +00:00
|
|
|
#ifndef GAME_RENDER_CELLBORDER
|
|
|
|
#define GAME_RENDER_CELLBORDER
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <osg/Group>
|
|
|
|
|
2023-05-14 18:00:02 +00:00
|
|
|
#include <components/esm/refid.hpp>
|
|
|
|
|
2021-07-09 17:05:27 +00:00
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
class SceneManager;
|
|
|
|
}
|
|
|
|
|
2018-06-12 23:48:31 +00:00
|
|
|
namespace Terrain
|
|
|
|
{
|
2021-07-29 13:33:58 +00:00
|
|
|
class Storage;
|
2018-06-14 11:43:32 +00:00
|
|
|
class World;
|
2018-06-12 23:48:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @Brief Handles the debug cell borders.
|
|
|
|
*/
|
|
|
|
class CellBorder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node>> CellGrid;
|
|
|
|
|
2021-07-09 17:05:27 +00:00
|
|
|
CellBorder(Terrain::World* world, osg::Group* root, int borderMask, Resource::SceneManager* sceneManager);
|
2018-06-12 23:48:31 +00:00
|
|
|
|
|
|
|
void createCellBorderGeometry(int x, int y);
|
|
|
|
void destroyCellBorderGeometry(int x, int y);
|
|
|
|
|
2018-06-14 10:01:09 +00:00
|
|
|
/**
|
|
|
|
Destroys the geometry for all borders.
|
|
|
|
*/
|
|
|
|
void destroyCellBorderGeometry();
|
|
|
|
|
2021-09-29 15:10:58 +00:00
|
|
|
static osg::ref_ptr<osg::Group> createBorderGeometry(float x, float y, float size, Storage* terrain,
|
2023-05-14 18:00:02 +00:00
|
|
|
Resource::SceneManager* sceneManager, int mask, ESM::RefId worldspace, float offset = 10.0,
|
|
|
|
osg::Vec4f color = { 1, 1, 0, 0 });
|
2021-07-29 13:33:58 +00:00
|
|
|
|
2018-06-12 23:48:31 +00:00
|
|
|
protected:
|
|
|
|
Terrain::World* mWorld;
|
2021-07-09 17:05:27 +00:00
|
|
|
Resource::SceneManager* mSceneManager;
|
2018-06-12 23:48:31 +00:00
|
|
|
osg::Group* mRoot;
|
|
|
|
|
|
|
|
CellGrid mCellBorderNodes;
|
2020-04-20 16:47:14 +00:00
|
|
|
int mBorderMask;
|
2018-06-12 23:48:31 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|