From: Markus R. <rol...@us...> - 2007-02-12 19:33:57
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4581 Modified Files: Tag: WIN32 world.cpp world.h world_c.cpp Log Message: - added GetAutoDisableFlag(), SetAutoDisableFlag() and SetContactSurfaceLayer() Index: world_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/world_c.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** world_c.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- world_c.cpp 12 Feb 2007 19:33:54 -0000 1.1.2.1 *************** *** 84,87 **** --- 84,129 ---- } + FUNCTION(World,setAutoDisableFlag) + { + float inFlag; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inFlag)) + ) + { + return false; + } + + obj->SetAutoDisableFlag(inFlag); + return true; + } + + FUNCTION(World,getAutoDisableFlag) + { + return obj->GetAutoDisableFlag(); + } + + FUNCTION(World,setContactSurfaceLayer) + { + float inDepth; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inDepth)) + ) + { + return false; + } + + obj->SetContactSurfaceLayer(inDepth); + return true; + } + + FUNCTION(World,getContactSurfaceLayer) + { + return obj->GetContactSurfaceLayer(); + } + void CLASS(World)::DefineClass() { *************** *** 92,94 **** --- 134,140 ---- DEFINE_FUNCTION(setCFM); DEFINE_FUNCTION(getCFM); + DEFINE_FUNCTION(setAutoDisableFlag); + DEFINE_FUNCTION(getAutoDisableFlag); + DEFINE_FUNCTION(setContactSurfaceLayer); + DEFINE_FUNCTION(getContactSurfaceLayer); } Index: world.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/world.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** world.h 22 Jan 2006 18:57:15 -0000 1.2 --- world.h 12 Feb 2007 19:33:54 -0000 1.2.2.1 *************** *** 89,92 **** --- 89,105 ---- void Step(float deltaTime); + bool GetAutoDisableFlag() const; + void SetAutoDisableFlag(bool flag); + + /** Set and get the depth of the surface layer around all geometry + objects. Contacts are allowed to sink into the surface layer up to + the given depth before coming to rest. The default value is + zero. Increasing this to some small value (e.g. 0.001) can help + prevent jittering problems due to contacts being repeatedly made + and broken. + */ + void SetContactSurfaceLayer(float depth); + float GetContactSurfaceLayer() const; + protected: /** creates them managed ODE world */ Index: world.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/world.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** world.cpp 22 Jan 2006 18:57:14 -0000 1.2 --- world.cpp 12 Feb 2007 19:33:54 -0000 1.2.2.1 *************** *** 85,88 **** --- 85,108 ---- } + bool World::GetAutoDisableFlag() const + { + return (static_cast<bool>(dWorldGetAutoDisableFlag(mODEWorld))); + } + + void World::SetAutoDisableFlag(bool flag) + { + dWorldSetAutoDisableFlag(mODEWorld, static_cast<int>(flag)); + } + + void World::SetContactSurfaceLayer(float depth) + { + dWorldSetContactSurfaceLayer(mODEWorld, depth); + } + + float World::GetContactSurfaceLayer() const + { + return dWorldGetContactSurfaceLayer(mODEWorld); + } + bool World::ConstructInternal() { |