1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

50 lines
1.1 KiB
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 {
2012-01-21 20:05:08 -05:00
static const int CELL_SIZE = 8192;
2012-01-14 18:34:14 -05:00
Ogre::Camera *mCamera;
Ogre::SceneManager *mSceneManager;
Ogre::Viewport *mViewport;
Ogre::RenderTarget *mRefractionTarget;
Ogre::RenderTarget *mReflectionTarget;
Ogre::Plane mWaterPlane;
Ogre::SceneNode *mWaterNode;
Ogre::Entity *mWater;
Ogre::Vector3 mOldCameraPos;
bool mIsUnderwater;
2012-01-20 17:59:56 -05:00
int mTop;
2012-01-14 18:34:14 -05:00
void preRenderTargetUpdate(const Ogre::RenderTargetEvent&);
void postRenderTargetUpdate(const Ogre::RenderTargetEvent&);
void cameraPreRenderScene(Ogre::Camera *cam);
void cameraPostRenderScene(Ogre::Camera *cam);
void cameraDestroyed(Ogre::Camera *cam);
2012-01-21 20:05:08 -05:00
Ogre::Vector3 getSceneNodeCoordinates(int gridX, int gridY);
2012-01-14 18:34:14 -05:00
public:
2012-01-21 20:05:08 -05:00
Water (Ogre::Camera *camera, const ESM::Cell* cell);
2012-01-14 18:34:14 -05:00
~Water();
2012-01-20 17:59:56 -05:00
void checkUnderwater(float y);
2012-01-21 20:05:08 -05:00
void changeCell(float x, float y);
2012-01-14 18:34:14 -05:00
};
}
#endif