source: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h @ 2320

Revision 2320, 3.2 KB checked in by szirmay, 17 years ago (diff)
Line 
1#pragma once
2
3//disable inheritance warning caused by multiple inheritance
4#if _WIN32
5#if _MSC_VER
6#pragma warning(disable: 4250)
7#endif
8#endif
9
10#include "OgreRenderingRun.h"
11#include "CubeMapRenderingRun.h"
12#include "OgreSharedRuns.h"
13
14
15/**
16        @brief CubeMapRenderingRun used in an OGRE environment.
17*/
18class OgreCubeMapRenderingRun : public OgreRenderingRun,
19                                                                public CubeMapRenderingRun
20{       
21public:
22
23        /**
24                @brief Constructor.
25
26                @param sharedRuns                       a pointer to the OgreSharedRuns this run belongs to
27                @param name                                     the name of the cubemap texture to be created
28                @param startFrame                       adds an offset to the current frame number to help evenly distribute updates between frames
29                @param updateInterval           update frequency
30                @param resolution                       cubemap resolution
31                @param useDistCalc                      flag to skip cube face update if object is far away
32                @param useFaceAngleCalc         flag to skip cube face update if face is neglible
33                @param distTolerance            distance tolerance used in face skip
34                @param angleTolerance           angle tolerance used in face skip               
35                @param updateAllFace            defines if all cubemap faces should be updated in a frame or only one face per frame
36                @param renderSelf                       sets if the object should be rendered to the cube map
37                @param renderEnvironment        sets if the environment should be rendered to the cube map
38                @param selfMaterial                     the material that should be set for the object while rendering the cubemap
39                @param environmentMaterial  the material that should be set for the environment while rendering the cubemap
40                @param getMinMax                        sets if the minimum and maximum values of the cubemap should be computed               
41        */     
42        OgreCubeMapRenderingRun(OgreSharedRuns* sharedRuns,
43                                                                 String name,
44                                                                 unsigned long startFrame,
45                                                                 unsigned long updateInterval,
46                                                                 unsigned int resolution,
47                                                                 bool useDistCalc,
48                                                                 bool useFaceAngleCalc,
49                                                                 float distTolerance,
50                                                                 float angleTolerance,
51                                                                 bool updateAllFace,
52                                                                 bool renderSelf,
53                                                                 bool renderEnvironment,
54                                                                 String selfMaterial,
55                                                                 String environmentMaterial,
56                                                                 bool getMinMax,
57                                                                 RenderingRunType cubemapRunType);
58
59        virtual ~OgreCubeMapRenderingRun(){}
60
61        /**
62                @brief returns the name of the resulting color cubemap texture
63        */
64        String getCubeMapTextureName(){return name;}
65
66        Vector4 getMax(){return max;}
67        Vector4 getMin(){return min;}
68
69        void freeAllResources();
70       
71protected:
72
73        /**
74                @brief A pointer to the OgreSharedRuns this run belongs to.
75        */
76        OgreSharedRuns* sharedRuns;
77        /**
78                @brief The name of the cubemap texture that was created by this run.
79        */
80        String name;
81        /**
82                @brief A pointer to the cubemap texture that was created by this run.
83        */
84        Texture* cubemapTexture;
85        /**
86                @brief
87        */
88        String selfMaterial;
89        /**
90                @brief
91        */
92        bool useSelfMaterial;
93        /**
94                @brief
95        */
96        String environmentMaterial;
97        /**
98                @brief
99        */
100        bool useEnvMaterial;
101        RenderingRunType cubemapRunType;
102
103        Vector4 min;
104        Vector4 max;
105
106        /**
107                @brief
108        */
109        bool getMinMax;
110       
111        void getCubeMapMinMax();
112        //inherited
113        inline void createCubeMap();
114        //inherited
115        inline void updateCubeFace(int facenum);
116        //inherited
117    bool faceNeedsUpdate(int facenum); 
118};
Note: See TracBrowser for help on using the repository browser.