Revision: 8626
http://playerstage.svn.sourceforge.net/playerstage/?rev=8626&view=rev
Author: hsujohnhsu
Date: 2010-04-26 18:09:36 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
check body befor enabling, in case it's the world
Modified Paths:
--------------
code/gazebo/trunk/server/physics/ode/ODESliderJoint.cc
Modified: code/gazebo/trunk/server/physics/ode/ODESliderJoint.cc
===================================================================
--- code/gazebo/trunk/server/physics/ode/ODESliderJoint.cc 2010-04-26
18:09:23 UTC (rev 8625)
+++ code/gazebo/trunk/server/physics/ode/ODESliderJoint.cc 2010-04-26
18:09:36 UTC (rev 8626)
@@ -97,8 +97,8 @@
void ODESliderJoint::SetAxis( int /*index*/, const Vector3 &axis )
{
this->physics->LockMutex();
- this->body1->SetEnabled(true);
- this->body2->SetEnabled(true);
+ if (this->body1) this->body1->SetEnabled(true);
+ if (this->body2) this->body2->SetEnabled(true);
dJointSetSliderAxis( this->jointId, axis.x, axis.y, axis.z );
this->physics->UnlockMutex();
@@ -109,8 +109,8 @@
void ODESliderJoint::SetForce(int /*index*/, double force)
{
this->physics->LockMutex();
- this->body1->SetEnabled(true);
- this->body2->SetEnabled(true);
+ if (this->body1) this->body1->SetEnabled(true);
+ if (this->body2) this->body2->SetEnabled(true);
dJointAddSliderForce(this->jointId, force);
this->physics->UnlockMutex();
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