1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 00:19:56 +00:00
openmw-tes3mp/apps/openmw/mwrender/water.hpp
2012-01-21 20:05:08 -05:00

49 lines
1.1 KiB
C++

#ifndef GAME_MWRENDER_WATER_H
#define GAME_MWRENDER_WATER_H
#include <Ogre.h>
#include <components/esm/loadcell.hpp>
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;
Ogre::RenderTarget *mRefractionTarget;
Ogre::RenderTarget *mReflectionTarget;
Ogre::Plane mWaterPlane;
Ogre::SceneNode *mWaterNode;
Ogre::Entity *mWater;
Ogre::Vector3 mOldCameraPos;
bool mIsUnderwater;
int mTop;
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);
Ogre::Vector3 getSceneNodeCoordinates(int gridX, int gridY);
public:
Water (Ogre::Camera *camera, const ESM::Cell* cell);
~Water();
void checkUnderwater(float y);
void changeCell(float x, float y);
};
}
#endif