#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "DistanceCubeMapRenderTechnique.h" #include "OgreRenderTechnique.h" #include "Ogre.h" using namespace Ogre; /** @brief DistanceCubeMapRenderTechnique used in an Ogre environment. */ class OgreDistanceCubeMapRenderTechnique : public DistanceCubeMapRenderTechnique, public OgreRenderTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param cubeMapUpdateInterval update frequency @param cubeMapResolution distance cubemap resolution @param texID the id of the texture unit state the resulting cubemap should be bound to @param useDistCalc flag to skip cube face update if object is far away @param useFaceAngleCalc flag to skip cube face update if face is neglible @param distTolerance distance tolerance used in face skip @param angleTolerance angle tolerance used in face skip @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame @param pass the pass to operate on @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ OgreDistanceCubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, unsigned char texID, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ ~OgreDistanceCubeMapRenderTechnique(); //inherited void update(unsigned long frameNum); protected: /** @brief the id of the texture unit state the resulting cubemap should be bound to */ unsigned char texID; //inherited void distanceCubeMapRunChanged(RenderingRun* run); //inherited RenderingRun* createDistanceCubeMapRun(); //inherited void distanceCubeMapRunUpdated(RenderingRun* run); }; class OgreDistanceCubeMapRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreDistanceCubeMapRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); unsigned long startFrame; unsigned long cubeMapUpdateInterval; unsigned int cubeMapResolution; unsigned char texID; bool useDistCalc; bool useFaceAngleCalc; float distTolerance; float angleTolerance; bool updateAllFace; };