1 | #include "Ogre.h"
|
---|
2 | #include "OgreEffectWrapper.h"
|
---|
3 | #include "managedogrerendertexturepass.h"
|
---|
4 | #include "DEMFinalGatheringPass.h"
|
---|
5 | #include "DEMFinalRenderingRun.h"
|
---|
6 |
|
---|
7 | DEMFinalRenderingRun::DEMFinalRenderingRun(Entity* entity)
|
---|
8 | {
|
---|
9 | Root* mRoot=Root::getSingletonPtr();
|
---|
10 | OgreAssert(mRoot!=NULL,"Root is not yet generated, rendering will fail.");
|
---|
11 | this->entity=entity;
|
---|
12 | demFinalRenderingRunPass=new DEMFinalGatheringPass(mRoot);
|
---|
13 | }
|
---|
14 |
|
---|
15 | void DEMFinalRenderingRun::setEnvMapPostition(Vector3 envMapPosition){
|
---|
16 | demFinalRenderingRunPass->setEnvMapPostition(envMapPostion);
|
---|
17 | }
|
---|
18 |
|
---|
19 | void DEMFinalRenderingRun::setDiffuseColor(float diffuseColor){
|
---|
20 | demFinalRenderingRunPass->setDiffuseColor(diffuseColor);
|
---|
21 | }
|
---|
22 |
|
---|
23 | DEMFinalRenderingRun::~DEMFinalRenderingRun(void)
|
---|
24 | {
|
---|
25 | }
|
---|
26 |
|
---|
27 | void DEMFinalRenderingRun::update(void){
|
---|
28 | if(entity->isVisible()){
|
---|
29 | SceneManager::EntityIterator entityIterator=mSceneMgr->getEntityIterator();
|
---|
30 | while(entityIterator.hasMoreElements()){
|
---|
31 | Entity* entityTemp=entityIterator.getNext();
|
---|
32 | entityVisibilityList.push_back(entityTemp->isVisible());
|
---|
33 | entityTemp->setVisible(false);
|
---|
34 | }
|
---|
35 | entity->setVisible(true);
|
---|
36 |
|
---|
37 | demFinalRenderingRunPass->update();
|
---|
38 |
|
---|
39 | SceneManager::EntityIterator entityIterator=mSceneMgr->getEntityIterator();
|
---|
40 | int elementNumber=0;
|
---|
41 | while(entityIterator.hasMoreElements()){
|
---|
42 | Entity* entity=entityIterator.getNext();
|
---|
43 | entity->setVisible(entityVisibilityList.at(elementNumber));
|
---|
44 | elementNumber++;
|
---|
45 | }
|
---|
46 | entityVisibilityList.clear();
|
---|
47 | }
|
---|
48 | } |
---|