#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderingRun.h" #include "OgreSharedRuns.h" /** @brief FocusingMapRenderingRun. A run to help focusing light projections for shadow mapping. */ class OgreFocusingMapRenderingRun : public OgreRenderingRun { public: /** @brief Constructor. @param name the name of the focusing map texture to be created @param lightMatrix the light matrix to be focused @param focusingMapSize size of the focusing map */ OgreFocusingMapRenderingRun(String name, Matrix4 lightMatrix, unsigned int focusingMapSize); virtual ~OgreFocusingMapRenderingRun(){} /** @brief returns the name of the focusing texture */ String getFocusingTextureName(){return name;} /** @brief gets the boundig box min-max points These values are given in light space and can be used to adjust the light matrices to focuse on important objects only. */ void getMinMax(Vector3& min, Vector3& max); /** @brief Sets the light matrix that should be focused. */ void setLightMatrix(Matrix4 &m){this->lightMatrix = m;} /** @brief Sets the player camera matrices. */ void setCameraMatrices(const Matrix4 &view, const Matrix4 &projection); void freeAllResources(); protected: /** @brief light matrix to be focused */ Matrix4 lightMatrix; /** @brief fosusing map camera */ Camera* camera; /** @brief the name of the focusing texture that was created by this run */ String name; /** @brief a pointer to the focusing texture that was created by this run */ Texture* focusingTexture; /** @brief the size of the focusing map */ unsigned int focusingMapSize; //inherited void updateFrame(unsigned long frameNum); /** @brief creates the focusing map texture */ inline void createFocusingMap(); //inherited bool needUpdate(unsigned long frameNum ) { return true; } };