source: GTP/branches/IllumWPdeliver2008dec/IlluminationWP/source/IllumModule/src/RenderingRuns/ReducedCubeMapRenderingRun.cpp @ 3255

Revision 3255, 1.1 KB checked in by szirmay, 15 years ago (diff)
Line 
1#include "ReducedCubeMapRenderingRun.h"
2
3
4
5ReducedCubeMapRenderingRun::ReducedCubeMapRenderingRun(unsigned long startFrame,
6                                                                                                                unsigned long updateInterval,
7                                                                                                                unsigned int resolution,
8                                                                                                                   bool useDistCalc,
9                                                                                                                   bool useFaceAngleCalc,
10                                                                                                                   float distTolerance,
11                                                                                                                   float angleTolerance,
12                                                                                                                   bool updateAllFace)
13                                                                                                                   :RenderingRun(startFrame, updateInterval)
14{
15        this->useDistCalc = useDistCalc;
16        this->useFaceAngleCalc = useFaceAngleCalc;
17        this->distTolerance = distTolerance;
18        this->angleTolerance = angleTolerance;
19        this->resolution = resolution;
20        this->updateAllFace = updateAllFace;
21
22        currentFace = 0;
23}
24
25void ReducedCubeMapRenderingRun::updateFrame(unsigned long frameNum)
26{
27        if(updateAllFace)
28        {
29                for(int i=0;i<6;i++)
30                {
31                        updateCubeFace(i);
32                }
33        }
34        else
35        {
36                if(lastupdated == 0 && updateInterval == 0)
37                {
38                        for(int i=0;i<6;i++)
39                        {
40                                updateCubeFace(i);
41                        }
42                }
43                else
44                {
45                        if(faceNeedsUpdate(currentFace))
46                                updateCubeFace(currentFace);
47
48                        currentFace = (currentFace + 1) % 6;
49                }
50        }
51}
Note: See TracBrowser for help on using the repository browser.