1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwrender/water.hpp

48 lines
1.1 KiB
C++
Raw Normal View History

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