#pragma once #include "CubeMapRenderTechnique.h" /** @brief Base abstract class of rendering a distance cube map. This technique defines that the final rendering of an object needs a cubemap of the distance of the surrounding environment from the cubemap center. */ class DistanceCubeMapRenderTechnique : virtual public CubeMapRenderTechnique { 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 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 renderSelf sets if the object should be rendered to the cube map @param renderEnvironment sets if the environment should be rendered to the cube map @param layer the layer of this cubemap @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ DistanceCubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, bool renderSelf, bool renderEnvironment, int layer, ElementaryRenderable* parentRenderable, TechniqueGroup* parentTechniqueGroup ); virtual ~DistanceCubeMapRenderTechnique(); /** @brief Updates the resources in the given frame. @param frameNum the actual framenumber */ virtual void update(unsigned long frameNum); //inherited virtual void runUpdated(RenderingRunType runType, RenderingRun* run); //inherited void runChanged(RenderingRunType runType, RenderingRun* run); protected: /** @brief Called if the changed run is a CubeMapRenderingRun (containing distances of the current layer). @param run pointer to the changed CubeMapRenderingRun */ virtual void distanceCubeMapRunChanged(RenderingRun* run) = 0; /** @brief Called if the changed run is a CubeMapRenderingRun (containing distances of the current layer). @param run pointer to the changed CubeMapRenderingRun */ virtual void distanceCubeMapRunUpdated(RenderingRun* run) = 0; };