source: trunk/BUTE/Ogre/FinalRenderingRuns/SEMFinalRenderingRun.cpp @ 125

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

Added a folder remotely

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