Changeset 1592 for code/branches/core3/src/orxonox/objects/Ambient.cc
- Timestamp:
- Jun 12, 2008, 4:32:10 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/orxonox/objects/Ambient.cc
r1586 r1592 64 64 } 65 65 66 bool Ambient::create(){ 67 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_); 68 return Synchronisable::create(); 66 bool Ambient::create() 67 { 68 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_); 69 return Synchronisable::create(); 69 70 } 70 71 71 void Ambient::registerAllVariables() {72 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);73 72 void Ambient::registerAllVariables() 73 { 74 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA); 74 75 } 75 76 76 void Ambient:: loadParams(TiXmlElement* xmlElem)77 void Ambient::setAmbientLight(const ColourValue& colour) 77 78 { 78 if (xmlElem->Attribute("colourvalue")) 79 { 80 SubString colourvalues(xmlElem->Attribute("colourvalue"), ','); 81 82 float r, g, b; 83 convertValue<std::string, float>(&r, colourvalues[0]); 84 convertValue<std::string, float>(&g, colourvalues[1]); 85 convertValue<std::string, float>(&b, colourvalues[2]); 86 87 this->setAmbientLight(ColourValue(r, g, b)); 88 89 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b << std::endl << std::endl; 90 } 91 } 92 93 void Ambient::setAmbientLight(const ColourValue& colour) 94 { 95 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 96 ambientLight_=colour; 97 } 79 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 80 ambientLight_=colour; 81 } 98 82 99 83 /** … … 107 91 BaseObject::XMLPort(xmlelement, mode); 108 92 109 XMLPortParam LoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);93 XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode); 110 94 create(); 111 95 }
Note: See TracChangeset
for help on using the changeset viewer.