Line | |
---|
1 | #include "CausticCubeMapRenderingRun.h"
|
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 | CausticCubeMapRenderingRun::CausticCubeMapRenderingRun(unsigned long startFrame,
|
---|
6 | unsigned long updateInterval,
|
---|
7 | unsigned int resolution,
|
---|
8 | bool updateAllFace)
|
---|
9 | :RenderingRun(startFrame, updateInterval)
|
---|
10 | {
|
---|
11 | this->resolution = resolution;
|
---|
12 | this->updateAllFace = updateAllFace;
|
---|
13 | currentFace = 0;
|
---|
14 | }
|
---|
15 |
|
---|
16 | void CausticCubeMapRenderingRun::updateFrame(unsigned long frameNum)
|
---|
17 | {
|
---|
18 |
|
---|
19 | if(updateAllFace)
|
---|
20 | {
|
---|
21 | for(int i=0;i<6;i++)
|
---|
22 | {
|
---|
23 | updateCubeFace(i);
|
---|
24 | }
|
---|
25 | }
|
---|
26 | else
|
---|
27 | {
|
---|
28 | if(lastupdated == 0 && updateInterval == 0)
|
---|
29 | {
|
---|
30 | for(int i=0;i<6;i++)
|
---|
31 | {
|
---|
32 | updateCubeFace(i);
|
---|
33 | }
|
---|
34 | }
|
---|
35 | else
|
---|
36 | {
|
---|
37 | if(faceNeedsUpdate(currentFace))
|
---|
38 | updateCubeFace(currentFace);
|
---|
39 |
|
---|
40 | currentFace = (currentFace + 1) % 6;
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.