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 | */
|
---|
18 | class OgreCubeMapRenderingRun : public OgreRenderingRun,
|
---|
19 | public CubeMapRenderingRun
|
---|
20 | {
|
---|
21 | public:
|
---|
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 | @brief returns the name of the resulting color cubemap texture
|
---|
60 | */
|
---|
61 | String getCubeMapTextureName(){return name;}
|
---|
62 |
|
---|
63 | Vector4 getMax(){return max;}
|
---|
64 | Vector4 getMin(){return min;}
|
---|
65 |
|
---|
66 | protected:
|
---|
67 |
|
---|
68 | /**
|
---|
69 | @brief A pointer to the OgreSharedRuns this run belongs to.
|
---|
70 | */
|
---|
71 | OgreSharedRuns* sharedRuns;
|
---|
72 | /**
|
---|
73 | @brief The name of the cubemap texture that was created by this run.
|
---|
74 | */
|
---|
75 | String name;
|
---|
76 | /**
|
---|
77 | @brief A pointer to the cubemap texture that was created by this run.
|
---|
78 | */
|
---|
79 | Texture* cubemapTexture;
|
---|
80 | /**
|
---|
81 | @brief
|
---|
82 | */
|
---|
83 | String selfMaterial;
|
---|
84 | /**
|
---|
85 | @brief
|
---|
86 | */
|
---|
87 | bool useSelfMaterial;
|
---|
88 | /**
|
---|
89 | @brief
|
---|
90 | */
|
---|
91 | String environmentMaterial;
|
---|
92 | /**
|
---|
93 | @brief
|
---|
94 | */
|
---|
95 | bool useEnvMaterial;
|
---|
96 | RenderingRunType cubemapRunType;
|
---|
97 |
|
---|
98 | Vector4 min;
|
---|
99 | Vector4 max;
|
---|
100 |
|
---|
101 | /**
|
---|
102 | @brief
|
---|
103 | */
|
---|
104 | bool getMinMax;
|
---|
105 |
|
---|
106 | void getCubeMapMinMax();
|
---|
107 | //inherited
|
---|
108 | inline void createCubeMap();
|
---|
109 | //inherited
|
---|
110 | inline void updateCubeFace(int facenum);
|
---|
111 | //inherited
|
---|
112 | bool faceNeedsUpdate(int facenum);
|
---|
113 | };
|
---|