Revision: 7162 http://playerstage.svn.sourceforge.net/playerstage/?rev=7162&view=rev Author: natepak Date: 2008-11-21 01:34:37 +0000 (Fri, 21 Nov 2008)
Log Message: ----------- Fixed the factory example, and fixed deleting models via a factory Modified Paths: -------------- code/gazebo/trunk/examples/libgazebo/factory/factory.cc code/gazebo/trunk/server/rendering/OgreVisual.cc Modified: code/gazebo/trunk/examples/libgazebo/factory/factory.cc =================================================================== --- code/gazebo/trunk/examples/libgazebo/factory/factory.cc 2008-11-20 00:52:29 UTC (rev 7161) +++ code/gazebo/trunk/examples/libgazebo/factory/factory.cc 2008-11-21 01:34:37 UTC (rev 7162) @@ -1,6 +1,7 @@ #include <sstream> #include <gazebo/gazebo.h> #include <gazebo/GazeboError.hh> +#include <string.h> int main() { @@ -57,10 +58,13 @@ stream << "<xyz>" << i*0.5 << " 0 1</xyz>"; stream << "<body:sphere name='sphere_body_" << i << "'>"; stream << "<geom:sphere name='sphere_geom_" << i << "'>"; - stream << "<mesh>default</mesh>"; stream << "<size>0.1</size>"; stream << "<density>1.0</density>"; - stream << "<material>Gazebo/Rocky</material>"; + stream << "<visual>"; + stream << "<size>0.1 0.1 0.1</size>"; + stream << "<material>Gazebo/Rocky</material>"; + stream << "<mesh>unit_sphere</mesh>"; + stream << "</visual>"; stream << "</geom:sphere>"; stream << "</body:sphere>"; stream << "</model:physical>"; Modified: code/gazebo/trunk/server/rendering/OgreVisual.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreVisual.cc 2008-11-20 00:52:29 UTC (rev 7161) +++ code/gazebo/trunk/server/rendering/OgreVisual.cc 2008-11-21 01:34:37 UTC (rev 7162) @@ -95,6 +95,16 @@ delete this->meshTileP; delete this->materialNameP; delete this->castShadowsP; + + if (this->parentNode) + this->parentNode->removeChild( this->sceneNode ); + + this->sceneNode->removeAndDestroyAllChildren(); + + if (this->sceneNode) + OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->sceneNode); + if (this->boundingBoxNode) + OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->boundingBoxNode); } //////////////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit