Revision: 8675
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8675&view=rev
Author:   hsujohnhsu
Date:     2010-05-12 03:07:21 +0000 (Wed, 12 May 2010)

Log Message:
-----------
add optional background color specification

Modified Paths:
--------------
    code/gazebo/trunk/server/rendering/OgreAdaptor.cc
    code/gazebo/trunk/server/rendering/OgreAdaptor.hh

Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2010-05-12 02:33:57 UTC 
(rev 8674)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2010-05-12 03:07:21 UTC 
(rev 8675)
@@ -205,6 +205,7 @@
   this->skyMaterialP = new ParamT<std::string>("material","",1);
   this->shadowIndexSizeP = new ParamT<int>("shadowIndexSize",32768, 0);
   this->shadowColorP = new ParamT<Vector3>("shadowColor",Vector3(0.4,0.4,0.4), 
0);
+  this->backgroundColorP = new 
ParamT<Vector3>("backgroundColor",Vector3(0,0,0), 0);
 
   Param::End();
 }
@@ -225,6 +226,7 @@
   delete this->shadowIndexSizeP;
   delete this->shadowTechniqueP;
   delete this->shadowColorP;
+  delete this->backgroundColorP;
   delete this->drawGridP;
   delete this->skyMaterialP;
 
@@ -257,9 +259,6 @@
     gzthrow("Unable to create an Ogre rendering environment, no Root ");
   }
 
-  // Default background color
-  this->backgroundColor = new Ogre::ColourValue(Ogre::ColourValue::White);
-
   // Load all the plugins
   this->LoadPlugins();
 
@@ -336,6 +335,7 @@
   this->shadowIndexSizeP->Load(node);
   this->shadowTechniqueP->Load(node);
   this->shadowColorP->Load(node);
+  this->backgroundColorP->Load(node);
   this->drawGridP->Load(node);
 
   ambient.r = (**(this->ambientP)).x;
@@ -372,6 +372,12 @@
     this->sceneMgr->setShadowFarDistance(30);
   }
 
+  // Default background color
+  this->backgroundColor = new Ogre::ColourValue(Ogre::ColourValue(
+          (**this->backgroundColorP).x,
+          (**this->backgroundColorP).y,
+          (**this->backgroundColorP).z));
+
   // Ambient lighting
   this->sceneMgr->setAmbientLight(ambient);
 

Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.hh
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.hh   2010-05-12 02:33:57 UTC 
(rev 8674)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.hh   2010-05-12 03:07:21 UTC 
(rev 8675)
@@ -167,6 +167,7 @@
     private: ParamT<int> *shadowTextureSizeP;
     private: ParamT<int> *shadowIndexSizeP;
     private: ParamT<Vector3> *shadowColorP;
+    private: ParamT<Vector3> *backgroundColorP;
     private: ParamT<bool> *drawGridP;
     private: ParamT<std::string> *skyMaterialP;
     private: std::vector<Param*> parameters;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------

_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to