1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/apps/opencs/view/render/cellwater.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.5 KiB
C++
Raw Normal View History

2016-08-05 02:58:55 +00:00
#ifndef CSV_RENDER_CELLWATER_H
#define CSV_RENDER_CELLWATER_H
#include <string>
#include <osg/ref_ptr>
2022-10-19 17:02:00 +00:00
#include <QModelIndex>
2016-08-05 02:58:55 +00:00
#include <QObject>
2022-10-10 11:41:36 +00:00
class QModelIndex;
2016-08-05 02:58:55 +00:00
namespace osg
{
class Geometry;
class Group;
class PositionAttitudeTransform;
}
namespace CSMWorld
{
2016-08-05 19:39:08 +00:00
struct Cell;
2016-08-05 02:58:55 +00:00
class CellCoordinates;
class Data;
2022-10-10 11:41:36 +00:00
template <typename ESXRecordT>
struct Record;
2016-08-05 02:58:55 +00:00
}
namespace CSVRender
{
/// For exterior cells, this adds a patch of water to fit the size of the cell. For interior cells with water, this
/// adds a large patch of water much larger than the typical size of a cell.
class CellWater : public QObject
{
Q_OBJECT
2022-09-22 18:26:05 +00:00
public:
2016-08-05 02:58:55 +00:00
CellWater(CSMWorld::Data& data, osg::Group* cellNode, const std::string& id,
const CSMWorld::CellCoordinates& cellCoords);
~CellWater();
2016-08-05 02:58:55 +00:00
2017-08-21 00:55:56 +00:00
void updateCellData(const CSMWorld::Record<CSMWorld::Cell>& cellRecord);
2016-08-05 02:58:55 +00:00
void reloadAssets();
private slots:
void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
2022-09-22 18:26:05 +00:00
private:
void recreate();
2016-08-05 02:58:55 +00:00
static const int CellSize;
CSMWorld::Data& mData;
std::string mId;
osg::Group* mParentNode;
osg::ref_ptr<osg::PositionAttitudeTransform> mWaterTransform;
osg::ref_ptr<osg::Group> mWaterGroup;
2016-08-05 02:58:55 +00:00
osg::ref_ptr<osg::Geometry> mWaterGeometry;
bool mDeleted;
bool mExterior;
bool mHasWater;
};
}
#endif