OpenMW
apps/openmw/mwrender/refraction.hpp
Go to the documentation of this file.
00001 #ifndef MWRENDER_REFRACTION_H
00002 #define MWRENDER_REFRACTION_H
00003 
00004 #include <OgrePlane.h>
00005 #include <OgreRenderTargetListener.h>
00006 #include <OgreRenderQueueListener.h>
00007 
00008 namespace Ogre
00009 {
00010     class Camera;
00011     class RenderTarget;
00012 }
00013 
00014 namespace MWRender
00015 {
00016 
00017     class Refraction : public Ogre::RenderTargetListener, public Ogre::RenderQueueListener
00018     {
00019 
00020     public:
00021         Refraction(Ogre::Camera* parentCamera);
00022         ~Refraction();
00023 
00024         void setHeight (float height);
00025         void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
00026         void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
00027         void setUnderwater(bool underwater) {mIsUnderwater = underwater;}
00028         void setActive (bool active);
00029 
00030         void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation);
00031         void renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation);
00032 
00033     private:
00034         Ogre::Camera* mParentCamera;
00035         Ogre::Camera* mCamera;
00036         Ogre::RenderTarget* mRenderTarget;
00037         Ogre::Plane mNearClipPlane;
00038         Ogre::Plane mNearClipPlaneUnderwater;
00039         bool mRenderActive;
00040         bool mIsUnderwater;
00041     };
00042 
00043 }
00044 
00045 #endif