Revision: 7509
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7509&view=rev
Author:   hsujohnhsu
Date:     2009-03-17 01:21:53 +0000 (Tue, 17 Mar 2009)

Log Message:
-----------
updates for headless mode.

Modified Paths:
--------------
    code/gazebo/branches/ogre-1.4.9/server/physics/PlaneGeom.cc

Modified: code/gazebo/branches/ogre-1.4.9/server/physics/PlaneGeom.cc
===================================================================
--- code/gazebo/branches/ogre-1.4.9/server/physics/PlaneGeom.cc 2009-03-17 
01:17:37 UTC (rev 7508)
+++ code/gazebo/branches/ogre-1.4.9/server/physics/PlaneGeom.cc 2009-03-17 
01:21:53 UTC (rev 7509)
@@ -32,6 +32,7 @@
 #include "Body.hh"
 #include "ContactParams.hh"
 #include "PlaneGeom.hh"
+#include "Simulator.hh"
 
 using namespace gazebo;
 
@@ -110,7 +111,8 @@
 {
   double altitude = 0;
 
-  this->meshName = OgreCreator::CreatePlane(**(this->normalP), 
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    this->meshName = OgreCreator::CreatePlane(**(this->normalP), 
       **(this->sizeP), **(this->segmentsP), **(this->uvTileP), 
       **(this->materialP), **(this->castShadowsP), this->GetVisualNode(), 
       this->meshName);
@@ -128,7 +130,8 @@
 /// Set the normal
 void PlaneGeom::SetNormal( const Vector3 &norm )
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->normalP->SetValue( norm );
   this->CreatePlane();
 }
@@ -137,7 +140,8 @@
 // Set the size
 void PlaneGeom::SetSize( const Vector2<double> &size )
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->sizeP->SetValue( size );
   this->CreatePlane();
 }
@@ -146,7 +150,8 @@
 // Set the number of segments
 void PlaneGeom::SetSegments(const Vector2<double> &seg)
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->segmentsP->SetValue( seg );
   this->CreatePlane();
 }
@@ -156,7 +161,8 @@
 // Set the uvtile
 void PlaneGeom::SetUVTile(const Vector2<double> &uv)
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->uvTileP->SetValue( uv );
   this->CreatePlane();
 }
@@ -165,7 +171,8 @@
 // Set the material
 void PlaneGeom::SetMaterial(const std::string &mat)
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->materialP->SetValue( mat );
   this->CreatePlane();
 }
@@ -174,7 +181,8 @@
 /// Set cast shadows
 void PlaneGeom::SetCastShadows(const bool &cast)
 {
-  OgreCreator::RemoveMesh(this->meshName);
+  if (Simulator::Instance()->GetRenderEngineEnabled())
+    OgreCreator::RemoveMesh(this->meshName);
   this->castShadowsP->SetValue( cast );
   this->CreatePlane();
 }


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

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to