[Opal-commits] opal/src Defines.h,1.75,1.76 Simulator.cpp,1.60,1.61 Simulator.h,1.98,1.99
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-04-14 09:15:33
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1968/src Modified Files: Defines.h Simulator.cpp Simulator.h Log Message: added a Simulator option to set the max physical contacts generated Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Simulator.cpp 12 Apr 2005 21:23:45 -0000 1.60 --- Simulator.cpp 14 Apr 2005 09:15:06 -0000 1.61 *************** *** 52,55 **** --- 52,56 ---- //setMaxAngularVel(defaults::maxAngularVel); setMaxCorrectingVel(defaults::maxCorrectingVel); + setMaxContacts(defaults::maxContacts); setUserData(NULL); setPostStepEventHandler(NULL); *************** *** 876,879 **** --- 877,891 ---- } + void Simulator::setMaxContacts(unsigned int mc) + { + assert(mc <= globals::maxMaxContacts); + mMaxContacts = mc; + } + + unsigned int Simulator::getMaxContacts()const + { + return mMaxContacts; + } + void Simulator::addSolid(Solid* s) { Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Defines.h 12 Apr 2005 21:23:44 -0000 1.75 --- Defines.h 14 Apr 2005 09:15:06 -0000 1.76 *************** *** 239,242 **** --- 239,246 ---- namespace globals { + /// The highest value that can be used for the Simulator's + /// max contacts parameter. + const int maxMaxContacts=(int)128; + // Pre-defined material settings const real metalHardness = (real)1.0; *************** *** 285,288 **** --- 289,293 ---- const bool staticSleepingContactsEnabled = false; const real maxCorrectingVel=(real)40.0; + const int maxContacts=(int)24; /// All groups make contacts with all other groups by default. *************** *** 395,399 **** const real autoDisableTimeMin=0; const real autoDisableTimeMax=(real)0.4; - const int maxContactPoints=(int)24; const real minMassRatio=(real)0.001; --- 400,403 ---- Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Simulator.h 12 Apr 2005 21:23:45 -0000 1.98 --- Simulator.h 14 Apr 2005 09:15:07 -0000 1.99 *************** *** 139,142 **** --- 139,151 ---- virtual real OPAL_CALL getMaxCorrectingVel()const; + /// Sets the maximum number of physical contacts generated when + /// two Solids collide. This number cannot be larger than the + /// global "max max contacts" parameter. + virtual void OPAL_CALL setMaxContacts(unsigned int mc); + + /// Returns the maximum number of physical contacts generated + /// when two Solids collide. + virtual unsigned int OPAL_CALL getMaxContacts()const; + /// Sets the maximum linear velocity for any Solid. This limits /// Solid motion to prevent explosions from numerical innacuracy. *************** *** 409,412 **** --- 418,425 ---- real mMaxCorrectingVel; + /// The maximum number of physical contacts generated when two + /// Solids collide. + unsigned int mMaxContacts; + private: }; |