- Timestamp:
- 05/08/07 14:37:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp
r2333 r2355 13 13 private: 14 14 String materialName; 15 String triggerName; 15 16 std::map<Renderable*, String>* visibleObjects; 16 17 public: 17 18 18 MaterialSetVisitor(String& materialName, std::map<Renderable*, String>* visibleObjects )19 MaterialSetVisitor(String& materialName, std::map<Renderable*, String>* visibleObjects, String trigger = "") 19 20 { 20 21 this->materialName = materialName; … … 29 30 { 30 31 (*visibleObjects)[rend] = rend->getMaterial().getPointer()->getName(); 31 rend->setMaterialName(materialName); 32 String materialToSet = materialName; 33 if(triggerName != "")//we have a trigger here 34 { 35 String triggeredMaterial = 36 ((OgreTechniqueGroup*)rend->getRenderTechniqueGroup()) 37 ->getMaterialNameForTrigger(triggerName); 38 if(triggeredMaterial != "")//a trigger is associated 39 materialToSet = triggeredMaterial; 40 } 41 rend->setMaterialName(materialToSet); 32 42 } 33 43 } … … 40 50 { 41 51 (*visibleObjects)[rend] = rend->getMaterial().getPointer()->getName(); 42 rend->setMaterialName(materialName); 52 String materialToSet = materialName; 53 if(triggerName != "")//we have a trigger here 54 { 55 String triggeredMaterial = 56 ((OgreTechniqueGroup*)rend->getRenderTechniqueGroup()) 57 ->getMaterialNameForTrigger(triggerName); 58 if(triggeredMaterial != "")//a trigger is associated 59 materialToSet = triggeredMaterial; 60 } 61 rend->setMaterialName(materialToSet); 43 62 } 44 63 } … … 127 146 } 128 147 129 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly )148 void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq, bool solidsonly, String triggerName) 130 149 { 131 150 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); … … 144 163 const QueuedRenderableCollection& solids = pPriorityGrp->getSolidsBasic(); 145 164 const QueuedRenderableCollection& transparents = pPriorityGrp->getTransparents(); 146 MaterialSetVisitor visitor(materialName, &visibleObjects );165 MaterialSetVisitor visitor(materialName, &visibleObjects, triggerName); 147 166 solids.acceptVisitor(&visitor, QueuedRenderableCollection::OM_PASS_GROUP); 148 167 if(!solidsonly) … … 166 185 } 167 186 168 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly, bool solidsonly )187 void OgreRenderingRun::setMaterialForVisibles(String& materialName, Camera* cam, bool shadowcastersonly, bool solidsonly, String triggerName) 169 188 { 170 189 SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); … … 183 202 sm->_findVisibleObjects(cam, shadowcastersonly); 184 203 185 setMaterialForRenderables(materialName, sm->getRenderQueue(), solidsonly );204 setMaterialForRenderables(materialName, sm->getRenderQueue(), solidsonly, triggerName); 186 205 } 187 206
Note: See TracChangeset
for help on using the changeset viewer.