Revision: 8788
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8788&view=rev
Author:   natepak
Date:     2010-06-23 16:51:54 +0000 (Wed, 23 Jun 2010)

Log Message:
-----------
Added ability to get the gravity mode of a body

Modified Paths:
--------------
    code/gazebo/trunk/server/physics/Body.hh
    code/gazebo/trunk/server/physics/bullet/BulletBody.cc
    code/gazebo/trunk/server/physics/bullet/BulletBody.hh
    code/gazebo/trunk/server/physics/ode/ODEBody.cc
    code/gazebo/trunk/server/physics/ode/ODEBody.hh

Modified: code/gazebo/trunk/server/physics/Body.hh
===================================================================
--- code/gazebo/trunk/server/physics/Body.hh    2010-06-23 16:39:45 UTC (rev 
8787)
+++ code/gazebo/trunk/server/physics/Body.hh    2010-06-23 16:51:54 UTC (rev 
8788)
@@ -92,6 +92,10 @@
     /// \brief Set whether gravity affects this body
     public: virtual void SetGravityMode(bool mode) = 0;
 
+    /// \brief Get the gravity mode
+    public: virtual bool GetGravityMode() = 0;
+
+
     /// \brief Set whether this body will collide with others in the model
     public: virtual void SetSelfCollide(bool collide) = 0;
 

Modified: code/gazebo/trunk/server/physics/bullet/BulletBody.cc
===================================================================
--- code/gazebo/trunk/server/physics/bullet/BulletBody.cc       2010-06-23 
16:39:45 UTC (rev 8787)
+++ code/gazebo/trunk/server/physics/bullet/BulletBody.cc       2010-06-23 
16:51:54 UTC (rev 8788)
@@ -209,6 +209,16 @@
 }
 
 
////////////////////////////////////////////////////////////////////////////////
+/// Get the gravity mode
+bool BulletBody::GetGravityMode()
+{
+  bool result;
+  gzerr(0) << "BulletBody::GetGravityMode not implemented\n";
+
+  return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 /// Set whether this body will collide with others in the model
 void BulletBody::SetSelfCollide(bool collide)
 {

Modified: code/gazebo/trunk/server/physics/bullet/BulletBody.hh
===================================================================
--- code/gazebo/trunk/server/physics/bullet/BulletBody.hh       2010-06-23 
16:39:45 UTC (rev 8787)
+++ code/gazebo/trunk/server/physics/bullet/BulletBody.hh       2010-06-23 
16:51:54 UTC (rev 8788)
@@ -106,6 +106,10 @@
     /// \brief Set whether gravity affects this body
     public: virtual void SetGravityMode(bool mode);
 
+    /// \brief Get the gravity mode
+    public: virtual bool GetGravityMode();
+
+
     /// \brief Set whether this body will collide with others in the model
     public: void SetSelfCollide(bool collide);
 

Modified: code/gazebo/trunk/server/physics/ode/ODEBody.cc
===================================================================
--- code/gazebo/trunk/server/physics/ode/ODEBody.cc     2010-06-23 16:39:45 UTC 
(rev 8787)
+++ code/gazebo/trunk/server/physics/ode/ODEBody.cc     2010-06-23 16:51:54 UTC 
(rev 8788)
@@ -147,6 +147,21 @@
 }
 
 
////////////////////////////////////////////////////////////////////////////////
+// Get the gravity mode
+bool ODEBody::GetGravityMode()
+{
+  int mode = 0;
+  if (this->bodyId)
+  {
+    this->physicsEngine->LockMutex();
+    mode = dBodyGetGravityMode(this->bodyId);
+    this->physicsEngine->UnlockMutex();
+  }
+
+  return mode;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // Set whether this body will collide with others in the model
 void ODEBody::SetSelfCollide(bool collide)
 {

Modified: code/gazebo/trunk/server/physics/ode/ODEBody.hh
===================================================================
--- code/gazebo/trunk/server/physics/ode/ODEBody.hh     2010-06-23 16:39:45 UTC 
(rev 8787)
+++ code/gazebo/trunk/server/physics/ode/ODEBody.hh     2010-06-23 16:51:54 UTC 
(rev 8788)
@@ -108,6 +108,9 @@
     /// \brief Set whether gravity affects this body
     public: virtual void SetGravityMode(bool mode);
 
+    /// \brief Get the gravity mode
+    public: virtual bool GetGravityMode();
+
     /// \brief Set whether this body will collide with others in the model
     public: void SetSelfCollide(bool collide);
 


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

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to