#pragma once #include "RenderingRun.h" /** @brief Base abstract class that defines a rendering process of a cubemap. */ class CubeMapRenderingRun : virtual public RenderingRun { public: /** @brief Constructor. @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 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 */ CubeMapRenderingRun(unsigned long startFrame, unsigned long updateInterval, unsigned int resolution, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, bool renderSelf, bool renderEnvironment); virtual ~CubeMapRenderingRun(){} protected: /** @brief defines if all cubemap faces should be updated in a frame or only one face per frame */ bool updateAllFace; /** @brief the number of the face to be updated */ unsigned char currentFace; /** @brief the resolution of the cubemap texture that was created by this run */ unsigned int resolution; /** @brief a flag to skip cube face update if object is far away or too small. @see distTolerance */ bool useDistCalc; /** @brief a flag to skip cube face update the face is neglible. @see angleTolerance */ bool useFaceAngleCalc; /** @brief A value used in face skip test. The higher this value gets the more precise, but slower the method will be. */ float distTolerance; /** @brief A value used in face skip test. The higher this value gets the more precise, but slower the method will be. */ float angleTolerance; /** @brief sets if the object should be rendered to the cube map */ bool renderSelf; /** @brief sets if the environment should be rendered to the cube map */ bool renderEnvironment; /** @brief Creates a cubemap texture used for the color-cubemap. */ virtual inline void createCubeMap() = 0; /** @brief Updates one face of the cubemap. @param facenum the number of the face to be updated */ virtual inline void updateCubeFace(int facenum) = 0; /** @brief Checks if a cubemap face needs to be updated. If the object we are updating the cubemap for is far from the camera, or too small, or the given cubemapface does not have significant effect on the rendering the face can be skipped. @param facenum the number of the face to be checked */ virtual bool faceNeedsUpdate(int facenum) = 0; //inherited virtual void updateFrame(unsigned long frameNum); };