source: trunk/BUTE/src/FinalRenderingRuns/FEMFinalRenderingRun.cpp @ 125

Revision 125, 1.7 KB checked in by barsi, 19 years ago (diff)

Added a folder remotely

RevLine 
[125]1#include "Ogre.h"
2#include "OgreEffectWrapper.h"
3#include "managedogrerendertexturepass.h"
4#include "FEMFinalRenderingRunpass.h"
5#include "FEMFinalRenderingRun.h"
6
7FEMFinalRenderingRun::FEMFinalRenderingRun(Entity* entity,RenderTarget* backBuffer,const String& textureName)
8{       
9       
10        Root* mRoot=Root::getSingletonPtr();
11        OgreAssert(mRoot!=NULL,"Root is not yet generated, rendering will fail.");
12        this->entity=entity;
13        this->backBuffer=backBuffer;
14        FEMFinalRenderingRunPass=new FEMFinalRenderingRunPass(mRoot);
15        FEMFinalRenderingRunPass->addRenderTarget(backBuffer);
16        FEMFinalRenderingRunPass->changeTexture(textureName,0);
17}
18
19void FEMFinalRenderingRun::setEnvMapPostition(Vector3 envMapPosition){
20        FEMFinalRenderingRunPass->setEnvMapPostition(envMapPostion);
21}
22
23void FEMFinalRenderingRun::setFresnelFactor(float fresnelFactor){
24        FEMFinalRenderingRunPass->setFresnelFactor(fresnelFactor);
25}
26
27FEMFinalRenderingRun::~FEMFinalRenderingRun(void)
28{
29}
30
31void FEMFinalRenderingRun::update(void){
32        if(entity->isVisible()){
33                SceneManager::EntityIterator entityIterator=mSceneMgr->getEntityIterator();
34                while(entityIterator.hasMoreElements()){
35                        Entity* entityTemp=entityIterator.getNext();
36                        entityVisibilityList.push_back(entityTemp->isVisible());
37                        entityTemp->setVisible(false);
38                }
39                entity->setVisible(true);
40
41                FEMFinalRenderingRunPass->update();
42               
43                SceneManager::EntityIterator entityIterator=mSceneMgr->getEntityIterator();
44                int elementNumber=0;
45                while(entityIterator.hasMoreElements()){
46                        Entity* entity=entityIterator.getNext();
47                        entity->setVisible(entityVisibilityList.at(elementNumber));
48                        elementNumber++;
49                }
50                entityVisibilityList.clear();
51        }
52}
Note: See TracBrowser for help on using the repository browser.