#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderingRun.h" #include "PhotonMapRenderingRun.h" #include "OgreSharedRuns.h" /** @brief ColorCubeMapRenderingRun used in an OGRE environment. */ class OgrePhotonMapRenderingRun : public OgreRenderingRun, public PhotonMapRenderingRun { public: /** @brief Constructor. @param sharedRuns a pointer to the OgreSharedRuns this run belongs to @param name the name of the texture to be created @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param updateInterval update frequency @param resolution color cubemap resolution @param materialName the name of the material should be used when rendering the choton hit map @param useDistance tells if a distance cubemap impostor should be used in photon hit calculation (recommended) */ OgrePhotonMapRenderingRun(OgreSharedRuns* sharedRuns, String name, unsigned long startFrame, unsigned long updateInterval, unsigned int resolution, String materialName, bool useDistance); /** @brief returns the name of the resulting photon hit map */ String getPhotonMapTextureName(){return name;} /** @brief Refreshes light camera matrices, called in each update. */ void refreshLight(); bool canJoin(OgreRenderingRun* run) { OgrePhotonMapRenderingRun* r = (OgrePhotonMapRenderingRun*) run; if(r->materialName == materialName) return true; return false; } void distanceCubeMapChanged(RenderingRun* run); void distanceCubeMapUpdated(RenderingRun* run); protected: /** @brief the name of the material should be used when rendering the choton hit map */ String materialName; /** @brief pointer to the nearest light source from the caster object */ Light* light; /** @brief the created photon hit map texture */ Camera* photonMapCamera; /** @brief tells if a distance cubemap impostor should be used in photon hit calculation (recommended) */ bool useDistance; /** @brief a pointer to the OgreSharedRuns this run belongs to */ OgreSharedRuns* sharedRuns; /** @brief the name of the photonmap texture that was created by this run */ String name; /** @brief a pointer to the photonmap texture that was created by this run */ Texture* photonMapTexture; /** @brief the resolution of the photonmap texture that was created by this run */ unsigned int resolution; //inherited void updateFrame(unsigned long frameNum); //inherited inline void createPhotonMap(); };