Update of /cvsroot/opal/opal/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13926/src
Modified Files:
BlueprintManager.cpp Defines.h Joint.cpp Joint.h JointData.h
Simulator.h
Log Message:
added a "contacts enabled" feature to Joints
Index: Defines.h
===================================================================
RCS file: /cvsroot/opal/opal/src/Defines.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** Defines.h 8 Mar 2005 16:10:23 -0000 1.67
--- Defines.h 8 Mar 2005 22:05:02 -0000 1.68
***************
*** 328,332 ****
const real breakThresh = (real)100.0;
const real accumThresh = (real)1000.0;
! const bool enableContacts = false;
}
--- 328,332 ----
const real breakThresh = (real)100.0;
const real accumThresh = (real)1000.0;
! const bool contactsEnabled = false;
}
Index: BlueprintManager.cpp
===================================================================
RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** BlueprintManager.cpp 5 Mar 2005 21:26:23 -0000 1.30
--- BlueprintManager.cpp 8 Mar 2005 22:05:02 -0000 1.31
***************
*** 486,489 ****
--- 486,512 ----
}
+ // Load ContactsEnabled element if it exists.
+ paramNodePtr =
+ const_cast<TiXmlNode*>(nodePtr)->FirstChild("ContactsEnabled");
+ if (NULL != paramNodePtr)
+ {
+ std::string value = getAttributeString(paramNodePtr, "value");
+ if ("true" == value)
+ {
+ data->contactsEnabled = true;
+ }
+ else if ("false" == value)
+ {
+ data->contactsEnabled = false;
+ }
+ else
+ {
+ OPAL_LOGGER("warning") <<
+ "opal::BlueprintManager::loadJoint: Invalid value "
+ << value << " for Joint ContactsEnabled parameter in "
+ << filename << " will be ignored." << std::endl;
+ }
+ }
+
// Loop over Axis elements if they exist.
TiXmlNode* axisNodePtr = NULL;
Index: Joint.cpp
===================================================================
RCS file: /cvsroot/opal/opal/src/Joint.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Joint.cpp 8 Mar 2005 16:10:23 -0000 1.25
--- Joint.cpp 8 Mar 2005 22:05:03 -0000 1.26
***************
*** 67,70 ****
--- 67,80 ----
}
+ void Joint::setContactsEnabled(bool e)
+ {
+ mData.contactsEnabled;
+ }
+
+ bool Joint::areContactsEnabled()const
+ {
+ return mData.contactsEnabled;
+ }
+
JointType Joint::getType()const
{
Index: Joint.h
===================================================================
RCS file: /cvsroot/opal/opal/src/Joint.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** Joint.h 8 Mar 2005 16:10:23 -0000 1.63
--- Joint.h 8 Mar 2005 22:05:03 -0000 1.64
***************
*** 74,77 ****
--- 74,85 ----
virtual const std::string& OPAL_CALL getName()const;
+ /// Sets whether the Joint's two Solids are constrained by
+ /// physical contacts.
+ virtual void OPAL_CALL setContactsEnabled(bool e);
+
+ /// Returns whether the Joint's two Solids are constrained by
+ /// physical contacts.
+ virtual bool OPAL_CALL areContactsEnabled()const;
+
/// Returns the Joint type.
virtual JointType OPAL_CALL getType()const;
Index: JointData.h
===================================================================
RCS file: /cvsroot/opal/opal/src/JointData.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** JointData.h 8 Mar 2005 16:10:23 -0000 1.4
--- JointData.h 8 Mar 2005 22:05:03 -0000 1.5
***************
*** 103,107 ****
accumThresh = defaults::joint::accumThresh;
accumDamage = 0;
! enableContacts = defaults::joint::enableContacts;
}
--- 103,107 ----
accumThresh = defaults::joint::accumThresh;
accumDamage = 0;
! contactsEnabled = defaults::joint::contactsEnabled;
}
***************
*** 139,143 ****
accumThresh = data.accumThresh;
accumDamage = data.accumDamage;
! enableContacts = data.enableContacts;
}
--- 139,143 ----
accumThresh = data.accumThresh;
accumDamage = data.accumDamage;
! contactsEnabled = data.contactsEnabled;
}
***************
*** 199,204 ****
/// Determines whether Solids connected by this Joint should make
! /// contacts when they collide.
! bool enableContacts;
protected:
--- 199,206 ----
/// Determines whether Solids connected by this Joint should make
! /// contacts when they collide. If multiple Joints connect the same
! /// two Solids, each with different contactsEnabled settings,
! /// the behavior is undefined.
! bool contactsEnabled;
protected:
Index: Simulator.h
===================================================================
RCS file: /cvsroot/opal/opal/src/Simulator.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** Simulator.h 8 Mar 2005 16:10:23 -0000 1.80
--- Simulator.h 8 Mar 2005 22:05:03 -0000 1.81
***************
*** 160,164 ****
/// each other. Keep in mind that the following cases are already
/// ignored when performing collision detection: two sleeping
! /// Solids don't collide, two Solids connected by a fixed Joint
/// don't collide; two Solids connected by a Joint with its
/// contacts enabled property set to false don't collide.
--- 160,164 ----
/// each other. Keep in mind that the following cases are already
/// ignored when performing collision detection: two sleeping
! /// Solids don't collide; two Solids connected by a fixed Joint
/// don't collide; two Solids connected by a Joint with its
/// contacts enabled property set to false don't collide.
|