Revision: 7727
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7727&view=rev
Author:   natepak
Date:     2009-05-27 15:10:05 +0000 (Wed, 27 May 2009)

Log Message:
-----------
Added comments

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

Modified: code/gazebo/trunk/server/Rand.cc
===================================================================
--- code/gazebo/trunk/server/Rand.cc    2009-05-27 03:11:26 UTC (rev 7726)
+++ code/gazebo/trunk/server/Rand.cc    2009-05-27 15:10:05 UTC (rev 7727)
@@ -1,3 +1,29 @@
+/*
+ *  Gazebo - Outdoor Multi-Robot Simulator
+ *  Copyright (C) 2003  
+ *     Nate Koenig & Andrew Howard
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+/* Desc: Random number generator
+ * Author: Nate Koenig
+ * Date: 27 May 2009
+ * SVN: $Id:$
+ */
+
 #include <ctime>
 #include "Rand.hh"
 

Modified: code/gazebo/trunk/server/Rand.hh
===================================================================
--- code/gazebo/trunk/server/Rand.hh    2009-05-27 03:11:26 UTC (rev 7726)
+++ code/gazebo/trunk/server/Rand.hh    2009-05-27 15:10:05 UTC (rev 7727)
@@ -1,3 +1,29 @@
+/*
+ *  Gazebo - Outdoor Multi-Robot Simulator
+ *  Copyright (C) 2003  
+ *     Nate Koenig & Andrew Howard
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+/* Desc: Random number generator
+ * Author: Nate Koenig
+ * Date: 27 May 2009
+ * SVN: $Id:$
+ */
+
 #ifndef RAND_HH
 #define RAND_HH
 

Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2009-05-27 03:11:26 UTC 
(rev 7726)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc   2009-05-27 15:10:05 UTC 
(rev 7727)
@@ -196,8 +196,9 @@
   else
   {
     this->sceneType= SCENE_EXT;
-    this->sceneMgr = this->root->createSceneManager(Ogre::ST_EXTERIOR_CLOSE);
-    //this->sceneMgr = this->root->createSceneManager(Ogre::ST_EXTERIOR_FAR);
+    this->sceneMgr = this->root->createSceneManager(Ogre::ST_EXTERIOR_FAR);
+    //this->sceneMgr = this->root->createSceneManager(Ogre::ST_EXTERIOR_CLOSE);
+    //this->sceneMgr = this->root->createSceneManager(Ogre::ST_GENERIC);
   }
 
   Param::Begin(&this->parameters);
@@ -211,33 +212,42 @@
   this->drawGridP->Load(node);
   this->updateRateP->Load(node);
 
+  //Preload basic shapes that can be used anywhere
+  OgreCreator::LoadBasicShapes();
 
   ambient.r = (**(this->ambientP)).x;
   ambient.g = (**(this->ambientP)).y;
   ambient.b = (**(this->ambientP)).z;
   ambient.a = (**(this->ambientP)).w;
 
-  // Ambient lighting
-  this->sceneMgr->setAmbientLight(ambient);
-
-  this->sceneMgr->setShadowTextureSelfShadow(true);
-  this->sceneMgr->setShadowTexturePixelFormat(Ogre::PF_FLOAT16_R);
-  this->sceneMgr->setShadowTextureSize(**(this->shadowTextureSizeP));
-  this->sceneMgr->setShadowIndexBufferSize(**(this->shadowIndexSizeP) );
-  
+ 
   // Settings for shadow mapping
   if (**(this->shadowTechniqueP) == std::string("stencilAdditive"))
     this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_STENCIL_ADDITIVE );
+  else if (**(this->shadowTechniqueP) == std::string("stencilModulative"))
+    this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_STENCIL_MODULATIVE );
   else if (**(this->shadowTechniqueP) == std::string("textureAdditive"))
     this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_TEXTURE_ADDITIVE );
+  else if (**(this->shadowTechniqueP) == std::string("textureModulative"))
+    this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_TEXTURE_MODULATIVE );
   else if (**(this->shadowTechniqueP) == std::string("none"))
     this->sceneMgr->setShadowTechnique( Ogre::SHADOWTYPE_NONE );
   else 
     gzthrow(std::string("Unsupported shadow technique: ") + 
**(this->shadowTechniqueP) + "\n");
 
-  //Preload basic shapes that can be used anywhere
-  OgreCreator::LoadBasicShapes();
+  this->sceneMgr->setShadowTextureSelfShadow(true);
+  this->sceneMgr->setShadowTexturePixelFormat(Ogre::PF_FLOAT16_R);
+  this->sceneMgr->setShadowTextureSize(**(this->shadowTextureSizeP));
+  this->sceneMgr->setShadowIndexBufferSize(**(this->shadowIndexSizeP) );
 
+  // Ambient lighting
+  this->sceneMgr->setAmbientLight(ambient);
+
+  this->sceneMgr->setShadowTextureSettings(512,2);
+  this->sceneMgr->setShowDebugShadows(true);
+  this->sceneMgr->setShadowColour(Ogre::ColourValue(0.2, 0.2, 0.2));
+  this->sceneMgr->setShadowFarDistance(30);
+
   // Add a sky dome to our scene
   if (node->GetChild("sky"))
   {

Modified: code/gazebo/trunk/server/rendering/OgreCreator.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreCreator.cc   2009-05-27 03:11:26 UTC 
(rev 7726)
+++ code/gazebo/trunk/server/rendering/OgreCreator.cc   2009-05-27 15:10:05 UTC 
(rev 7727)
@@ -173,6 +173,7 @@
 
   // Set the direction which the light points
   vec = node->GetVector3("direction", Vector3(0.0, 0.0, -1.0));
+  vec.Normalize();
   light->setDirection(vec.x, vec.y, vec.z);
 
   // Absolute range of light in world coordinates
@@ -207,6 +208,8 @@
         Ogre::Radian(Ogre::Degree(vec.y)), vec.z);
   }
 
+  light->setCastShadows(node->GetBool("castShadows",false,0));
+
   parent->AttachObject(light);
 
   return stream.str();


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

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to