1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

41 lines
879 B
C++
Raw Normal View History

2012-01-14 18:34:14 -05:00
#ifndef GAME_MWRENDER_WATER_H
#define GAME_MWRENDER_WATER_H
#include <Ogre.h>
2012-01-21 20:05:08 -05:00
#include <components/esm/loadcell.hpp>
2012-01-14 18:34:14 -05:00
namespace MWRender {
/// Water rendering
class Water : Ogre::RenderTargetListener, Ogre::Camera::Listener
{
static const int CELL_SIZE = 8192;
Ogre::Camera *mCamera;
Ogre::SceneManager *mSceneManager;
Ogre::Viewport *mViewport;
2012-01-14 18:34:14 -05:00
Ogre::Plane mWaterPlane;
Ogre::SceneNode *mWaterNode;
Ogre::Entity *mWater;
2012-01-14 18:34:14 -05:00
bool mIsUnderwater;
int mTop;
2012-01-14 18:34:14 -05:00
Ogre::Vector3 getSceneNodeCoordinates(int gridX, int gridY);
2012-01-14 18:34:14 -05:00
public:
Water (Ogre::Camera *camera, const ESM::Cell* cell);
~Water();
2012-01-14 18:34:14 -05:00
void toggle();
2012-01-14 18:34:14 -05:00
void checkUnderwater(float y);
void changeCell(const ESM::Cell* cell);
void setHeight(const float height);
2012-01-14 18:34:14 -05:00
};
2012-01-14 18:34:14 -05:00
}
#endif