Revision: 8699
http://playerstage.svn.sourceforge.net/playerstage/?rev=8699&view=rev
Author: natepak
Date: 2010-05-20 04:00:22 +0000 (Thu, 20 May 2010)
Log Message:
-----------
Better saving
Modified Paths:
--------------
code/gazebo/trunk/server/gui/DirectionalLightMaker.cc
code/gazebo/trunk/server/gui/PointLightMaker.cc
code/gazebo/trunk/server/gui/SpotLightMaker.cc
code/gazebo/trunk/server/rendering/Light.cc
code/gazebo/trunk/server/rendering/OgreAdaptor.cc
Modified: code/gazebo/trunk/server/gui/DirectionalLightMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/DirectionalLightMaker.cc 2010-05-20
02:02:03 UTC (rev 8698)
+++ code/gazebo/trunk/server/gui/DirectionalLightMaker.cc 2010-05-20
04:00:22 UTC (rev 8699)
@@ -89,6 +89,7 @@
newModelStr << "<model:renderable name=\"" << this->lightName << "\">\
<xyz>" << p1.x << " " << p1.y << " " << 0.1 << "</xyz>\
+ <static>true</static>\
<light>\
<type>directional</type>\
<direction>.1 .1 -.9</direction>\
Modified: code/gazebo/trunk/server/gui/PointLightMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/PointLightMaker.cc 2010-05-20 02:02:03 UTC
(rev 8698)
+++ code/gazebo/trunk/server/gui/PointLightMaker.cc 2010-05-20 04:00:22 UTC
(rev 8699)
@@ -89,6 +89,7 @@
newModelStr << "<model:renderable name=\"" << this->lightName << "\">\
<xyz>" << p1.x << " " << p1.y << " " << 0.2 << "</xyz>\
+ <static>true</static>\
<light>\
<type>point</type>\
<specularColor>0.1 0.1 0.1</specularColor>\
Modified: code/gazebo/trunk/server/gui/SpotLightMaker.cc
===================================================================
--- code/gazebo/trunk/server/gui/SpotLightMaker.cc 2010-05-20 02:02:03 UTC
(rev 8698)
+++ code/gazebo/trunk/server/gui/SpotLightMaker.cc 2010-05-20 04:00:22 UTC
(rev 8699)
@@ -89,6 +89,7 @@
newModelStr << "<model:renderable name=\"" << this->lightName << "\">\
<xyz>" << p1.x << " " << p1.y << " " << 0.1 << "</xyz>\
+ <static>true</static>\
<light>\
<type>spot</type>\
<specularColor>0.1 0.1 0.1</specularColor>\
Modified: code/gazebo/trunk/server/rendering/Light.cc
===================================================================
--- code/gazebo/trunk/server/rendering/Light.cc 2010-05-20 02:02:03 UTC (rev
8698)
+++ code/gazebo/trunk/server/rendering/Light.cc 2010-05-20 04:00:22 UTC (rev
8699)
@@ -144,41 +144,17 @@
// Save a light
void Light::Save(const std::string &prefix, std::ostream &stream)
{
- std::string type;
-
- if (this->light->getType() == Ogre::Light::LT_POINT)
- type = "point";
- else if (this->light->getType() == Ogre::Light::LT_DIRECTIONAL)
- type = "directional";
- else
- type = "spot";
-
- Ogre::ColourValue diffuseColor = this->light->getDiffuseColour();
- Ogre::ColourValue specularColor = this->light->getDiffuseColour();
- Ogre::Vector3 dir = this->light->getDirection();
- Ogre::Real attRange = this->light->getAttenuationRange();
- Ogre::Real attConst = this->light->getAttenuationConstant();
- Ogre::Real attLinear = this->light->getAttenuationLinear();
- Ogre::Real attQuadric = this->light->getAttenuationQuadric();
-
stream << prefix << "<light>\n";
- stream << prefix << " <type>" << type << "</type>\n";
-
- stream << prefix << " <direction>" << dir.x << " " << dir.y << " "
- << dir.z << "</direction>\n";
-
- stream << prefix << " <diffuseColor>" << diffuseColor.r << " "
- << diffuseColor.g << " " << diffuseColor.b << " " << diffuseColor.a
- << "</diffuseColor>\n";
-
- stream << prefix << " <specularColor>" << specularColor.r << " "
- << specularColor.g << " " << specularColor.b << " "
- << specularColor.a << "</specularColor>\n";
-
- stream << prefix << " <range>"<< attRange << "</range>\n";
-
- stream << prefix << " <attenuation>" << " " << attConst
- << " " << attLinear << " " << attQuadric << "</attenuation>\n";
+ stream << prefix << " " << *(this->lightTypeP) << "\n";
+ stream << prefix << " " << *(this->directionP) << "\n";
+ stream << prefix << " " << *(this->diffuseP) << "\n";
+ stream << prefix << " " << *(this->specularP) << "\n";
+ stream << prefix << " " << *(this->rangeP) << "\n";
+ stream << prefix << " " << *(this->attenuationP) << "\n";
+ stream << prefix << " " << *(this->spotInnerAngleP) << "\n";
+ stream << prefix << " " << *(this->spotOutterAngleP) << "\n";
+ stream << prefix << " " << *(this->spotFalloffP) << "\n";
+ stream << prefix << " " << *(this->castShadowsP) << "\n";
stream << prefix << "</light>\n";
}
Modified: code/gazebo/trunk/server/rendering/OgreAdaptor.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-05-20 02:02:03 UTC
(rev 8698)
+++ code/gazebo/trunk/server/rendering/OgreAdaptor.cc 2010-05-20 04:00:22 UTC
(rev 8699)
@@ -287,9 +287,14 @@
stream << prefix << "<rendering:ogre>\n";
stream << prefix << " " << *(this->ambientP) << "\n";
stream << prefix << " " << *(this->drawGridP) << "\n";
- stream << prefix << " <sky>\n";
- stream << prefix << " " << *(this->skyMaterialP) << "\n";
- stream << prefix << " </sky>\n";
+
+ if ((**this->skyMaterialP).size())
+ {
+ stream << prefix << " <sky>\n";
+ stream << prefix << " " << *(this->skyMaterialP) << "\n";
+ stream << prefix << " </sky>\n";
+ }
+
OgreCreator::SaveFog(prefix, stream);
stream << prefix << " " << *(this->shadowsP) << "\n";
stream << prefix << "</rendering:ogre>\n";
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