From: <a-...@us...> - 2009-11-18 07:24:37
|
Revision: 102 http://simspark.svn.sourceforge.net/simspark/?rev=102&view=rev Author: a-held Date: 2009-11-18 07:24:29 +0000 (Wed, 18 Nov 2009) Log Message: ----------- bringing branch up to date Modified Paths: -------------- branches/multiphys/rcssserver3d/ChangeLog branches/multiphys/rcssserver3d/RELEASE branches/multiphys/spark/ChangeLog branches/multiphys/spark/RELEASE branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/oxygen.cpp branches/multiphys/spark/lib/oxygen/oxygen.h branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp branches/multiphys/spark/lib/oxygen/physicsserver/body.h branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h branches/multiphys/spark/lib/oxygen/physicsserver/space.h branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp branches/multiphys/spark/lib/oxygen/physicsserver/world.h branches/multiphys/spark/lib/oxygen/physicsserver/world_c.cpp branches/multiphys/spark/lib/oxygen/simulationserver/agentcontrol.cpp branches/multiphys/spark/lib/oxygen/simulationserver/agentcontrol.h branches/multiphys/spark/lib/oxygen/simulationserver/netcontrol.cpp branches/multiphys/spark/lib/oxygen/simulationserver/simulationserver.cpp branches/multiphys/spark/lib/oxygen/simulationserver/simulationserver.h branches/multiphys/spark/plugin/collisionperceptor/forceresistanceperceptor.cpp branches/multiphys/spark/plugin/collisionperceptor/forceresistanceperceptor.h branches/multiphys/spark/utility/rcssnet/socket.cpp branches/multiphys/spark/utility/rcssnet/socket.hpp Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/imp/ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odewrapper.h Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odewrapper.h branches/multiphys/spark/lib/oxygen/physicsserver/odeobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/odeobject.h branches/multiphys/spark/lib/oxygen/physicsserver/odeobject_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/odewrapper.h Property Changed: ---------------- branches/multiphys/ Property changes on: branches/multiphys ___________________________________________________________________ Added: svn:mergeinfo + /trunk:95-101 Modified: branches/multiphys/rcssserver3d/ChangeLog =================================================================== --- branches/multiphys/rcssserver3d/ChangeLog 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/rcssserver3d/ChangeLog 2009-11-18 07:24:29 UTC (rev 102) @@ -1,3 +1,8 @@ +2009-10-31 Hedayat Vatankhah <he...@gr...> + + * RELEASE: + - write about changes sine 0.6.2, initial draft. + 2009-08-24 Marian Buchta <mar...@gm...> * CMakeLists.txt: Modified: branches/multiphys/rcssserver3d/RELEASE =================================================================== --- branches/multiphys/rcssserver3d/RELEASE 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/rcssserver3d/RELEASE 2009-11-18 07:24:29 UTC (rev 102) @@ -1,15 +1,10 @@ -RELEASE News of rcssserver3d-0.6.2 +RELEASE News of rcssserver3d-0.6.3 (In progress) -This release is mainly a bug-fix release, and is the last release before -RoboCup 2009 competitions. - -* Some improvements: - - improved Windows and MacOSX support - - improved external monitor - - fixed a bug in rcssserver3d's goal counting - - added right kick-off key to the monitor (Simon Raffeiner) - - simspark can take command line argument specifying the rb script to run - (using --script-path command line option) - +* Most notable changes: + - No internal monitor by default. Run rcssmonitor3d separately to see the game. + - Added HMDP effector/perceptor + - Some compilation fixes + - Improved Windows support + You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: branches/multiphys/spark/ChangeLog =================================================================== --- branches/multiphys/spark/ChangeLog 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/ChangeLog 2009-11-18 07:24:29 UTC (rev 102) @@ -1,3 +1,24 @@ +2009-10-31 Hedayat Vatankhah <he...@gr...> + + * lib/oxygen/simulationserver/simulationserver.h: + * lib/oxygen/simulationserver/simulationserver.cpp: + - prevent a deadlock case (on exit) in multi-threaded mode + + * lib/oxygen/simulationserver/agentcontrol.h: + * lib/oxygen/simulationserver/agentcontrol.cpp: + - send senses in SenseAgent method, so that they'll be sent after receiving + commands from the agents. this will ensure that any commands sent after + sending senses will be executed in the next cycle, which results in a + more deterministic behaviour + +2009-10-30 Hedayat Vatankhah <he...@gr...> + + * lib/oxygen/simulationserver/netcontrol.cpp (NetControl::InitSimulation): + - try to set REUSEADDR flag to reuse local addresses. + + * utility/rcssnet/socket.cpp (Socket::setReuseAddr): + - added the new function + 2009-08-25 Marian Buchta <mar...@gm...> * plugin/openglsyswx/CMakeLists.txt: Modified: branches/multiphys/spark/RELEASE =================================================================== --- branches/multiphys/spark/RELEASE 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/RELEASE 2009-11-18 07:24:29 UTC (rev 102) @@ -1,15 +1,17 @@ -RELEASE News of simspark-0.1.2 +RELEASE News of simspark-0.1.3 (in progress) -This release brings some bugfixes, better performance and also better Windows -support. A Windows installer will be available too. This is the first version -which runs in multi-threaded mode by default. The multi-threaded mode is still -in early stages, and it can be improved cosiderably in future. +SOME INTERESTING COMMENTS! Main changes of this release are: - - improved Windows support, including Windows Installer. - - Multi-threaded mode now works, and is the default mode when running simspark - - Performance improvements - - Fixed a bug in networking code, which were introduced in 0.1.1 + - Compilation fixes + - Improved Windows support + - Simspark should always accept connections. No more "Connection refused" + messages and the need to wait for simspark's network port to be freed! + - Simspark will now collect received commands right before sending + sense data of the last cycle. So, any commands which is sent by agents + after receiving new sense data will be executed in the next cycle, not the + current one. This results in a more deterministic behavior, and agents' + efficiency should not change between remote and local runs considerably. You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-18 07:24:29 UTC (rev 102) @@ -21,8 +21,6 @@ physicsserver/collider.h physicsserver/collisionhandler.h physicsserver/contactjointhandler.h - physicsserver/odeobject.h - physicsserver/odewrapper.h physicsserver/physicsserver.h physicsserver/planecollider.h physicsserver/raycollider.h @@ -41,6 +39,15 @@ physicsserver/universaljoint.h physicsserver/hinge2joint.h physicsserver/angularmotor.h + + #interfaces + physicsserver/imp/worldimp.h + + #ode-specific files + physicsserver/ode/odeobject.h + physicsserver/ode/odeworld.h + physicsserver/ode/odewrapper.h + sceneserver/sceneimporter.h sceneserver/basenode.h sceneserver/fpscontroller.h @@ -116,8 +123,6 @@ physicsserver/collisionhandler_c.cpp physicsserver/contactjointhandler.cpp physicsserver/contactjointhandler_c.cpp - physicsserver/odeobject.cpp - physicsserver/odeobject_c.cpp physicsserver/physicsserver.cpp physicsserver/physicsserver_c.cpp physicsserver/planecollider.cpp @@ -152,6 +157,16 @@ physicsserver/hinge2joint_c.cpp physicsserver/angularmotor.cpp physicsserver/angularmotor_c.cpp + + #interfaces + physicsserver/imp/worldimp_c.cpp + + #ODE-specific files + physicsserver/ode/odeworld.cpp + physicsserver/ode/odeworld_c.cpp + physicsserver/ode/odeobject.cpp + physicsserver/ode/odeobject_c.cpp + sceneserver/basenode.cpp sceneserver/basenode_c.cpp sceneserver/fpscontroller.cpp Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -57,9 +57,9 @@ zg.GetCore()->RegisterClassObject(new CLASS(BodyController), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(DragController), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(VelocityController), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ODEObject), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Space), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(World), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(WorldImp), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Joint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(BallJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(HingeJoint), "oxygen/"); @@ -86,6 +86,11 @@ zg.GetCore()->RegisterClassObject(new CLASS(AgentAspect), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Effector), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Perceptor), "oxygen/"); + + //ODE-specific classes + zg.GetCore()->RegisterClassObject(new CLASS(ODEObject), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ODEWorld), "oxygen/"); + #ifdef HAVE_SPADES_HEADERS // spades Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-18 07:24:29 UTC (rev 102) @@ -34,6 +34,7 @@ #include "gamecontrolserver/actionobject.h" #include "gamecontrolserver/behavior.h" +//abstract physics classes #include "physicsserver/body.h" #include "physicsserver/bodycontroller.h" #include "physicsserver/dragcontroller.h" @@ -42,7 +43,6 @@ #include "physicsserver/boxcollider.h" #include "physicsserver/ccylindercollider.h" #include "physicsserver/collider.h" -#include "physicsserver/odeobject.h" #include "physicsserver/physicsserver.h" #include "physicsserver/planecollider.h" #include "physicsserver/raycollider.h" @@ -60,6 +60,13 @@ #include "physicsserver/universaljoint.h" #include "physicsserver/hinge2joint.h" +//physics interfaces +#include "physicsserver/imp/worldimp.h" + +//ode-specific includes +#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/ode/odeworld.h> + #include "sceneserver/basenode.h" #include "sceneserver/camera.h" #include "sceneserver/fpscontroller.h" Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -339,7 +339,7 @@ // direction: (1=x, 2=y, 3=z) int direction = 3; - dMassSetCappedCylinder (&mass, density, direction, radius, length); + dMassSetCapsule (&mass, density, direction, radius, length); } void Body::SetCappedCylinder (float density, float radius, float length) @@ -361,7 +361,7 @@ // direction: (1=x, 2=y, 3=z) int direction = 3; - dMassSetCappedCylinderTotal(&mass, total_mass, direction, radius, length); + dMassSetCapsuleTotal(&mass, total_mass, direction, radius, length); } void Body::SetCappedCylinderTotal(float total_mass, float radius, float length) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-18 07:24:29 UTC (rev 102) @@ -23,7 +23,7 @@ #define OXYGEN_BODY_H #include <oxygen/oxygen_defines.h> -#include "odeobject.h" +#include <oxygen/physicsserver/ode/odeobject.h> namespace oxygen { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-11-18 07:24:29 UTC (rev 102) @@ -23,7 +23,7 @@ #define OXYGEN_BOXCOLLIDER_H #include <oxygen/oxygen_defines.h> -#include "collider.h" +#include <oxygen/physicsserver/collider.h> namespace oxygen { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-18 07:24:29 UTC (rev 102) @@ -22,7 +22,7 @@ #ifndef OXYGEN_COLLIDER_H #define OXYGEN_COLLIDER_H -#include "odeobject.h" +#include <oxygen/physicsserver/ode/odeobject.h> #include <string> #include <set> #include <oxygen/oxygen_defines.h> Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h 2009-11-18 07:24:29 UTC (rev 102) @@ -24,7 +24,7 @@ #include <oxygen/sceneserver/basenode.h> #include <oxygen/oxygen_defines.h> -#include "odewrapper.h" +#include <oxygen/physicsserver/ode/odewrapper.h> namespace oxygen { Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/imp/worldimp.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h 2009-11-18 07:24:29 UTC (rev 102) @@ -1,116 +0,0 @@ -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2002,2003 Koblenz University - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: world.h 56 2009-03-17 18:03:47Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -#ifndef OXYGEN_WORLDIMP_H -#define OXYGEN_WORLDIMP_H - -#include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odeobject.h> - -namespace oxygen -{ - -/** World encapsulates an ODE world object. It is a container for - rigid bodies and joints. Objects in different worlds can not - interact, for example rigid bodies from two different worlds can - not collide. All the objects in a world exist at the same point in - time, thus one reason to use separate worlds is to simulate - systems at different rates. -*/ -class OXYGEN_API WorldImp : public ODEObject -{ - // - // Functions - // -public: - WorldImp() : ODEObject(){}; - virtual ~WorldImp(){}; - - /** returns the ID of the managed ODE world */ - virtual dWorldID GetODEWorldImp() const = 0; - - /** sets the gravity vector of this vorld */ - virtual void SetGravityImp(const salt::Vector3f& gravity) = 0; - - /** gets the gravity vector of this world */ - virtual salt::Vector3f GetGravityImp() const = 0; - - /** sets the Error Reduction Parameter of this world. The ERP - specifies what proportion of a joint error will be fixed - during the next simulation step. if ERP=0 then no correcting - force is applied and the bodies will eventually drift apart as - the simulation proceeds. If ERP=1 then the simulation will - attempt to fix all joint error during the next time - step. However, setting ERP=1 is not recommended, as the joint - error will not be completely fixed due to various internal - approximations. A value of ERP=0.1 to 0.8 is recommended (0.2 - is the default). - */ - virtual void SetERPImp(float erp) = 0; - - /** returns the Error Reduction Parameter of this World. - */ - virtual float GetERPImp() const = 0; - - /** sets the Constraint Force mixing (CFM) value. If CFM is set to - zero, the constraint will be hard. If CFM is set to a positive - value, it will be possible to violate the constraint by - `pushing on it' (for example, for contact constraints by - forcing the two contacting objects together). In other words - the constraint will be soft, and the softness will increase as - CFM increases. Note that setting CFM to a negative value can - have undesirable bad effects, such as instability. - */ - virtual void SetCFMImp(float cfm) = 0; - - /** returns the Constraint Force mixing (CFM) value. */ - virtual float GetCFMImp() const = 0; - - /** steps the world deltatime forward, i.e. performs physics - simulation for a deltaTime seconds interval. - */ - virtual void StepImp(float deltaTime) = 0; - - virtual bool GetAutoDisableFlagImp() const = 0; - virtual void SetAutoDisableFlagImp(bool flag) = 0; - - /** 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. - */ - virtual void SetContactSurfaceLayerImp(float depth) = 0; - virtual float GetContactSurfaceLayerImp() const = 0; - - /** destroy the managed ODE object */ - virtual void DestroyODEObjectImp() = 0; - - /** creates them managed ODE world */ - virtual bool ConstructInternalImp() = 0; -}; - -DECLARE_ABSTRACTCLASS(WorldImp); - -} - -#endif //OXYGEN_WORLDIMP_H Copied: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h (from rev 101, trunk/spark/lib/oxygen/physicsserver/imp/worldimp.h) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,116 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: world.h 56 2009-03-17 18:03:47Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef OXYGEN_WORLDIMP_H +#define OXYGEN_WORLDIMP_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odeobject.h> + +namespace oxygen +{ + +/** World encapsulates an ODE world object. It is a container for + rigid bodies and joints. Objects in different worlds can not + interact, for example rigid bodies from two different worlds can + not collide. All the objects in a world exist at the same point in + time, thus one reason to use separate worlds is to simulate + systems at different rates. +*/ +class OXYGEN_API WorldImp : public ODEObject +{ + // + // Functions + // +public: + WorldImp() : ODEObject(){}; + virtual ~WorldImp(){}; + + /** returns the ID of the managed ODE world */ + virtual dWorldID GetODEWorldImp() const = 0; + + /** sets the gravity vector of this vorld */ + virtual void SetGravityImp(const salt::Vector3f& gravity) = 0; + + /** gets the gravity vector of this world */ + virtual salt::Vector3f GetGravityImp() const = 0; + + /** sets the Error Reduction Parameter of this world. The ERP + specifies what proportion of a joint error will be fixed + during the next simulation step. if ERP=0 then no correcting + force is applied and the bodies will eventually drift apart as + the simulation proceeds. If ERP=1 then the simulation will + attempt to fix all joint error during the next time + step. However, setting ERP=1 is not recommended, as the joint + error will not be completely fixed due to various internal + approximations. A value of ERP=0.1 to 0.8 is recommended (0.2 + is the default). + */ + virtual void SetERPImp(float erp) = 0; + + /** returns the Error Reduction Parameter of this World. + */ + virtual float GetERPImp() const = 0; + + /** sets the Constraint Force mixing (CFM) value. If CFM is set to + zero, the constraint will be hard. If CFM is set to a positive + value, it will be possible to violate the constraint by + `pushing on it' (for example, for contact constraints by + forcing the two contacting objects together). In other words + the constraint will be soft, and the softness will increase as + CFM increases. Note that setting CFM to a negative value can + have undesirable bad effects, such as instability. + */ + virtual void SetCFMImp(float cfm) = 0; + + /** returns the Constraint Force mixing (CFM) value. */ + virtual float GetCFMImp() const = 0; + + /** steps the world deltatime forward, i.e. performs physics + simulation for a deltaTime seconds interval. + */ + virtual void StepImp(float deltaTime) = 0; + + virtual bool GetAutoDisableFlagImp() const = 0; + virtual void SetAutoDisableFlagImp(bool flag) = 0; + + /** 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. + */ + virtual void SetContactSurfaceLayerImp(float depth) = 0; + virtual float GetContactSurfaceLayerImp() const = 0; + + /** destroy the managed ODE object */ + virtual void DestroyODEObjectImp() = 0; + + /** creates them managed ODE world */ + virtual bool ConstructInternalImp() = 0; +}; + +DECLARE_ABSTRACTCLASS(WorldImp); + +} + +#endif //OXYGEN_WORLDIMP_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -1,29 +0,0 @@ -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- - -this file is part of rcssserver3D -Fri May 9 2003 -Copyright (C) 2003 Koblenz University -$Id: world_c.cpp 3 2008-11-21 02:38:08Z hedayat $ - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include <oxygen/physicsserver/imp/worldimp.h> - -using namespace oxygen; - -void CLASS(WorldImp)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/ODEObject); -} Copied: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp (from rev 101, trunk/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,29 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + +this file is part of rcssserver3D +Fri May 9 2003 +Copyright (C) 2003 Koblenz University +$Id: world_c.cpp 3 2008-11-21 02:38:08Z hedayat $ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include <oxygen/physicsserver/imp/worldimp.h> + +using namespace oxygen; + +void CLASS(WorldImp)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/ODEObject); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-11-18 07:24:29 UTC (rev 102) @@ -23,7 +23,7 @@ #define OXYGEN_JOINT_H #include <oxygen/oxygen_defines.h> -#include "odeobject.h" +#include <oxygen/physicsserver/ode/odeobject.h> namespace oxygen { Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -1,167 +0,0 @@ -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2002,2003 Koblenz University - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: odeobject.cpp 3 2008-11-21 02:38:08Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -#include <oxygen/physicsserver/ode/odeobject.h> -#include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/world.h> -#include <oxygen/sceneserver/scene.h> -#include <zeitgeist/logserver/logserver.h> - -using namespace oxygen; -using namespace boost; - -ODEObject::ODEObject() : BaseNode() -{ -} - -ODEObject::~ODEObject() -{ -} - -void ODEObject::OnUnlink() -{ - DestroyODEObject(); -} - -/** returns the world node */ -shared_ptr<World> ODEObject::GetWorld() -{ - shared_ptr<Scene> scene = GetScene(); - if (scene.get() == 0) - { - GetLog()->Error() << "(ODEObject) ERROR: found no Scene node\n"; - return shared_ptr<World>(); - } - - shared_ptr<World> worldNode = shared_dynamic_cast<World> - (scene->GetChildOfClass("World")); - if (worldNode.get() == 0) - { - GetLog()->Error() << "(ODEObject) ERROR: found no World node\n"; - } - - return worldNode; -} - -shared_ptr<Space> ODEObject::GetSpace() -{ - // try to find the nearest parent space object - weak_ptr<Space> parentSpace = FindParentSupportingClass<Space>(); - if (! parentSpace.expired()) - { - return parentSpace.lock(); - } - - // return the global space instance - shared_ptr<Scene> scene = GetScene(); - if (scene.get() == 0) - { - GetLog()->Error() << "(ODEObject) ERROR: found no Scene node\n"; - return shared_ptr<Space>(); - } - - shared_ptr<Space> spaceNode = shared_dynamic_cast<Space> - (scene->GetChildOfClass("Space")); - if (spaceNode.get() == 0) - { - GetLog()->Error() << "(ODEObject) ERROR: found no Space node\n"; - } - - return spaceNode; -} - -dWorldID ODEObject::GetWorldID() -{ - shared_ptr<World> world = GetWorld(); - if (world.get() == 0) - { - return 0; - } - - dWorldID worldId = world->GetODEWorld(); - if (worldId == 0) - { - GetLog()->Error() - << "(ODEObject) ERROR: World returned empty ODE handle\n"; - } - - return worldId; -} - -dSpaceID ODEObject::FindSpaceID() -{ - shared_ptr<Space> space = GetSpace(); - if (space.get() == 0) - { - return 0; - } - - dSpaceID spaceId = space->GetODESpace(); - - if (spaceId == 0) - { - GetLog()->Error() - << "(ODEObject) ERROR: Space returned empty ODE handle\n"; - } - - return spaceId; -} - -dSpaceID ODEObject::GetParentSpaceID() -{ - return 0; -} - -void ODEObject::ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix) -{ - matrix[0] = rot.m[0]; - matrix[1] = rot.m[4]; - matrix[2] = rot.m[8]; - matrix[3] = 0; - matrix[4] = rot.m[1]; - matrix[5] = rot.m[5]; - matrix[6] = rot.m[9]; - matrix[7] = 0; - matrix[8] = rot.m[2]; - matrix[9] = rot.m[6]; - matrix[10] = rot.m[10]; - matrix[11] = 0; -} - -void ODEObject::ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const -{ - rot.m[0] = matrix[0] ; - rot.m[4] = matrix[1] ; - rot.m[8] = matrix[2]; - rot.m[12] = matrix[3]; - rot.m[1] = matrix[4]; - rot.m[5] = matrix[5]; - rot.m[9] = matrix[6]; - rot.m[13] = matrix[7]; - rot.m[2] = matrix[8]; - rot.m[6] = matrix[9]; - rot.m[10] = matrix[10] ; - rot.m[14] = matrix[11]; - rot.m[3] = 0.0; - rot.m[7] = 0.0; - rot.m[11] = 0.0; - rot.m[15] = 1.0; -} Copied: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp (from rev 101, trunk/spark/lib/oxygen/physicsserver/ode/odeobject.cpp) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,167 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: odeobject.cpp 3 2008-11-21 02:38:08Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/sceneserver/scene.h> +#include <zeitgeist/logserver/logserver.h> + +using namespace oxygen; +using namespace boost; + +ODEObject::ODEObject() : BaseNode() +{ +} + +ODEObject::~ODEObject() +{ +} + +void ODEObject::OnUnlink() +{ + DestroyODEObject(); +} + +/** returns the world node */ +shared_ptr<World> ODEObject::GetWorld() +{ + shared_ptr<Scene> scene = GetScene(); + if (scene.get() == 0) + { + GetLog()->Error() << "(ODEObject) ERROR: found no Scene node\n"; + return shared_ptr<World>(); + } + + shared_ptr<World> worldNode = shared_dynamic_cast<World> + (scene->GetChildOfClass("World")); + if (worldNode.get() == 0) + { + GetLog()->Error() << "(ODEObject) ERROR: found no World node\n"; + } + + return worldNode; +} + +shared_ptr<Space> ODEObject::GetSpace() +{ + // try to find the nearest parent space object + weak_ptr<Space> parentSpace = FindParentSupportingClass<Space>(); + if (! parentSpace.expired()) + { + return parentSpace.lock(); + } + + // return the global space instance + shared_ptr<Scene> scene = GetScene(); + if (scene.get() == 0) + { + GetLog()->Error() << "(ODEObject) ERROR: found no Scene node\n"; + return shared_ptr<Space>(); + } + + shared_ptr<Space> spaceNode = shared_dynamic_cast<Space> + (scene->GetChildOfClass("Space")); + if (spaceNode.get() == 0) + { + GetLog()->Error() << "(ODEObject) ERROR: found no Space node\n"; + } + + return spaceNode; +} + +dWorldID ODEObject::GetWorldID() +{ + shared_ptr<World> world = GetWorld(); + if (world.get() == 0) + { + return 0; + } + + dWorldID worldId = world->GetODEWorld(); + if (worldId == 0) + { + GetLog()->Error() + << "(ODEObject) ERROR: World returned empty ODE handle\n"; + } + + return worldId; +} + +dSpaceID ODEObject::FindSpaceID() +{ + shared_ptr<Space> space = GetSpace(); + if (space.get() == 0) + { + return 0; + } + + dSpaceID spaceId = space->GetODESpace(); + + if (spaceId == 0) + { + GetLog()->Error() + << "(ODEObject) ERROR: Space returned empty ODE handle\n"; + } + + return spaceId; +} + +dSpaceID ODEObject::GetParentSpaceID() +{ + return 0; +} + +void ODEObject::ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix) +{ + matrix[0] = rot.m[0]; + matrix[1] = rot.m[4]; + matrix[2] = rot.m[8]; + matrix[3] = 0; + matrix[4] = rot.m[1]; + matrix[5] = rot.m[5]; + matrix[6] = rot.m[9]; + matrix[7] = 0; + matrix[8] = rot.m[2]; + matrix[9] = rot.m[6]; + matrix[10] = rot.m[10]; + matrix[11] = 0; +} + +void ODEObject::ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const +{ + rot.m[0] = matrix[0] ; + rot.m[4] = matrix[1] ; + rot.m[8] = matrix[2]; + rot.m[12] = matrix[3]; + rot.m[1] = matrix[4]; + rot.m[5] = matrix[5]; + rot.m[9] = matrix[6]; + rot.m[13] = matrix[7]; + rot.m[2] = matrix[8]; + rot.m[6] = matrix[9]; + rot.m[10] = matrix[10] ; + rot.m[14] = matrix[11]; + rot.m[3] = 0.0; + rot.m[7] = 0.0; + rot.m[11] = 0.0; + rot.m[15] = 1.0; +} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-18 07:24:29 UTC (rev 102) @@ -1,83 +0,0 @@ -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2002,2003 Koblenz University - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: odeobject.h 56 2009-03-17 18:03:47Z hedayat $ - $Id: odeobject.h 56 2009-03-17 18:03:47Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -#ifndef OXYGEN_ODEOBJECT_H -#define OXYGEN_ODEOBJECT_H - -#include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> -#include <oxygen/physicsserver/ode/odewrapper.h> - -namespace oxygen -{ -class Space; -class World; - -/** ODEObject is the base of all classes encapsulating ODE concepts - */ -class OXYGEN_API ODEObject : public BaseNode -{ -public: - // - // Functions - // - ODEObject(); - virtual ~ODEObject(); - - /** This rountine is called, before the hierarchy object is - removed from the parent. It can be overridden to support - custom 'unlink' behavior. - */ - virtual void OnUnlink(); - - /** returns the ODE world handle */ - dWorldID GetWorldID(); - - /** returns the nearest parent space ODE handle */ - dSpaceID FindSpaceID(); - - /** returns the ODE handle ID of the containing parent space */ - virtual dSpaceID GetParentSpaceID(); - - /** destroy the managed ODE object */ - virtual void DestroyODEObject(){}; - -protected: - /** returns the world node */ - boost::shared_ptr<World> GetWorld(); - - /** finds the nearest parent space node */ - boost::shared_ptr<Space> GetSpace(); - - /** converts the rotation part of a salt::Matrix to an ODE - dMatrix3 */ - void ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix); - - /** coverts the ODE dMatrix3 to the rotation part of a salt::Matrix */ - void ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const; -}; - -DECLARE_ABSTRACTCLASS(ODEObject); - -} //namespace oxygen - -#endif //OXYGEN_ODEOBJECT_H Copied: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h (from rev 101, trunk/spark/lib/oxygen/physicsserver/ode/odeobject.h) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,83 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: odeobject.h 56 2009-03-17 18:03:47Z hedayat $ + $Id: odeobject.h 56 2009-03-17 18:03:47Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef OXYGEN_ODEOBJECT_H +#define OXYGEN_ODEOBJECT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/sceneserver/basenode.h> +#include <oxygen/physicsserver/ode/odewrapper.h> + +namespace oxygen +{ +class Space; +class World; + +/** ODEObject is the base of all classes encapsulating ODE concepts + */ +class OXYGEN_API ODEObject : public BaseNode +{ +public: + // + // Functions + // + ODEObject(); + virtual ~ODEObject(); + + /** This rountine is called, before the hierarchy object is + removed from the parent. It can be overridden to support + custom 'unlink' behavior. + */ + virtual void OnUnlink(); + + /** returns the ODE world handle */ + dWorldID GetWorldID(); + + /** returns the nearest parent space ODE handle */ + dSpaceID FindSpaceID(); + + /** returns the ODE handle ID of the containing parent space */ + virtual dSpaceID GetParentSpaceID(); + + /** destroy the managed ODE object */ + virtual void DestroyODEObject(){}; + +protected: + /** returns the world node */ + boost::shared_ptr<World> GetWorld(); + + /** finds the nearest parent space node */ + boost::shared_ptr<Space> GetSpace(); + + /** converts the rotation part of a salt::Matrix to an ODE + dMatrix3 */ + void ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix); + + /** coverts the ODE dMatrix3 to the rotation part of a salt::Matrix */ + void ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const; +}; + +DECLARE_ABSTRACTCLASS(ODEObject); + +} //namespace oxygen + +#endif //OXYGEN_ODEOBJECT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -1,29 +0,0 @@ -/* -*- mode: c++ -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2003 Koblenz University - $Id: odeobject_c.cpp 3 2008-11-21 02:38:08Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include <oxygen/physicsserver/ode/odeobject.h> - -using namespace oxygen; - -void CLASS(ODEObject)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Copied: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp (from rev 101, trunk/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,29 @@ +/* -*- mode: c++ -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2003 Koblenz University + $Id: odeobject_c.cpp 3 2008-11-21 02:38:08Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include <oxygen/physicsserver/ode/odeobject.h> + +using namespace oxygen; + +void CLASS(ODEObject)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -1,138 +0,0 @@ -/* -*- mode: c++ -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2003 Koblenz University - $Id: world.cpp 3 2008-11-21 02:38:08Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include <oxygen/physicsserver/ode/odeworld.h> -#include <oxygen/physicsserver/space.h> -#include <oxygen/sceneserver/scene.h> - -using namespace boost; -using namespace oxygen; -using namespace salt; - -ODEWorld::ODEWorld() : WorldImp(), mODEWorld(0) -{ -} - -ODEWorld::~ODEWorld() -{ -} - -dWorldID ODEWorld::GetODEWorldImp() const -{ - return mODEWorld; -} - -void ODEWorld::SetGravityImp(const Vector3f& gravity) -{ - dWorldSetGravity(mODEWorld, - gravity.x(), - gravity.y(), - gravity.z() - ); -} - -salt::Vector3f ODEWorld::GetGravityImp() const -{ - dVector3 dGravity; - dWorldGetGravity(mODEWorld,dGravity); - return Vector3f(dGravity[0],dGravity[1],dGravity[2]); -} - -void ODEWorld::SetERPImp(float erp) -{ - dWorldSetERP(mODEWorld, erp); -} - -float ODEWorld::GetERPImp() const -{ - return dWorldGetERP(mODEWorld); -} - -void ODEWorld::SetCFMImp(float cfm) -{ - dWorldSetCFM(mODEWorld, cfm); -} - -float ODEWorld::GetCFMImp() const -{ - return dWorldGetCFM(mODEWorld); -} - -void ODEWorld::StepImp(float deltaTime) -{ - dWorldStep(mODEWorld, deltaTime); -} - -bool ODEWorld::GetAutoDisableFlagImp() const -{ - return (dWorldGetAutoDisableFlag(mODEWorld) == 1); -} - -void ODEWorld::SetAutoDisableFlagImp(bool flag) -{ - dWorldSetAutoDisableFlag(mODEWorld, static_cast<int>(flag)); -} - -void ODEWorld::SetContactSurfaceLayerImp(float depth) -{ - dWorldSetContactSurfaceLayer(mODEWorld, depth); -} - -float ODEWorld::GetContactSurfaceLayerImp() const -{ - return dWorldGetContactSurfaceLayer(mODEWorld); -} - -bool ODEWorld::ConstructInternalImp() -{ - // create an ode world - mODEWorld = dWorldCreate(); - - return (mODEWorld != 0); -} - -void ODEWorld::DestroyODEObjectImp() -{ - static bool recurseLock = false; - if (recurseLock) - { - return; - } - - recurseLock = true; - - shared_ptr<Space> space = GetSpace(); - if (space.get() != 0) - { - space->DestroyODEObject(); - } - - if (mODEWorld == 0) - { - return; - } - - // release the ODE world - dWorldDestroy(mODEWorld); - mODEWorld = 0; - - recurseLock = false; -} Copied: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp (from rev 101, trunk/spark/lib/oxygen/physicsserver/ode/odeworld.cpp) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,138 @@ +/* -*- mode: c++ -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2003 Koblenz University + $Id: world.cpp 3 2008-11-21 02:38:08Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include <oxygen/physicsserver/ode/odeworld.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/sceneserver/scene.h> + +using namespace boost; +using namespace oxygen; +using namespace salt; + +ODEWorld::ODEWorld() : WorldImp(), mODEWorld(0) +{ +} + +ODEWorld::~ODEWorld() +{ +} + +dWorldID ODEWorld::GetODEWorldImp() const +{ + return mODEWorld; +} + +void ODEWorld::SetGravityImp(const Vector3f& gravity) +{ + dWorldSetGravity(mODEWorld, + gravity.x(), + gravity.y(), + gravity.z() + ); +} + +salt::Vector3f ODEWorld::GetGravityImp() const +{ + dVector3 dGravity; + dWorldGetGravity(mODEWorld,dGravity); + return Vector3f(dGravity[0],dGravity[1],dGravity[2]); +} + +void ODEWorld::SetERPImp(float erp) +{ + dWorldSetERP(mODEWorld, erp); +} + +float ODEWorld::GetERPImp() const +{ + return dWorldGetERP(mODEWorld); +} + +void ODEWorld::SetCFMImp(float cfm) +{ + dWorldSetCFM(mODEWorld, cfm); +} + +float ODEWorld::GetCFMImp() const +{ + return dWorldGetCFM(mODEWorld); +} + +void ODEWorld::StepImp(float deltaTime) +{ + dWorldStep(mODEWorld, deltaTime); +} + +bool ODEWorld::GetAutoDisableFlagImp() const +{ + return (dWorldGetAutoDisableFlag(mODEWorld) == 1); +} + +void ODEWorld::SetAutoDisableFlagImp(bool flag) +{ + dWorldSetAutoDisableFlag(mODEWorld, static_cast<int>(flag)); +} + +void ODEWorld::SetContactSurfaceLayerImp(float depth) +{ + dWorldSetContactSurfaceLayer(mODEWorld, depth); +} + +float ODEWorld::GetContactSurfaceLayerImp() const +{ + return dWorldGetContactSurfaceLayer(mODEWorld); +} + +bool ODEWorld::ConstructInternalImp() +{ + // create an ode world + mODEWorld = dWorldCreate(); + + return (mODEWorld != 0); +} + +void ODEWorld::DestroyODEObjectImp() +{ + static bool recurseLock = false; + if (recurseLock) + { + return; + } + + recurseLock = true; + + shared_ptr<Space> space = GetSpace(); + if (space.get() != 0) + { + space->DestroyODEObject(); + } + + if (mODEWorld == 0) + { + return; + } + + // release the ODE world + dWorldDestroy(mODEWorld); + mODEWorld = 0; + + recurseLock = false; +} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h =================================================================== --- trunk/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-18 07:11:28 UTC (rev 101) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-18 07:24:29 UTC (rev 102) @@ -1,124 +0,0 @@ -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- - - this file is part of rcssserver3D - Fri May 9 2003 - Copyright (C) 2002,2003 Koblenz University - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: world.h 56 2009-03-17 18:03:47Z hedayat $ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -#ifndef OXYGEN_ODEWORLD_H -#define OXYGEN_ODEWORLD_H - -#include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/imp/worldimp.h> - -namespace oxygen -{ - -/** World encapsulates an ODE world object. It is a container for - rigid bodies and joints. Objects in different worlds can not - interact, for example rigid bodies from two different worlds can - not collide. All the objects in a world exist at the same point in - time, thus one reason to use separate worlds is to simulate - systems at different rates. -*/ -class OXYGEN_API ODEWorld : public WorldImp -{ - // - // Functions - // -public: - ODEWorld(); - virtual ~ODEWorld(); - - /** returns the ID of the managed ODE world */ - dWorldID GetODEWorldImp() const; - - /** sets the gravity vector of this vorld */ - void SetGravityImp(const salt::Vector3f& gravity); - - /** gets the gravity vector of this world */ - salt::Vector3f GetGravityImp() const; - - /** sets the Error Reduction Parameter of this world. The ERP - specifies what proportion of a joint error will be fixed - during the next simulation step. if ERP=0 then no correcting - force is applied and the bodies will eventually drift apart as - the simulation proceeds. If ERP=1 then the simulation will - attempt to fix all joint error during the next time - step. However, setting ERP=1 is not recommended, as the joint - error will not be completely fixed due to various internal - approximations. A value of ERP=0.1 to 0.8 is recommended (0.2 - is the default). - */ - void SetERPImp(float erp); - - /** returns the Error Reduction Parameter of this World. - */ - float GetERPImp() const; - - /** sets the Constraint Force mixing (CFM) value. If CFM is set to - zero, the constraint will be hard. If CFM is set to a positive - value, it will be possible to violate the constraint by - `pushing on it' (for example, for contact constraints by - forcing the two contacting objects together). In other words - the constraint will be soft, and the softness will increase as - CFM increases. Note that setting CFM to a negative value can - have undesirable bad effects, such as instability. - */ - void SetCFMImp(float cfm); - - /** returns the Constraint Force mixing (CFM) value. */ - float GetCFMImp() const; - - /** steps the world deltatime forward, i.e. performs physics - simulation for a deltaTime seconds interval. - */ - void StepImp(float deltaTime); - - bool GetAutoDisableFlagImp() const; - void SetAutoDisableFlagImp(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 SetContactSurfaceLayerImp(float depth); - float GetContactSurfaceLayerImp() const; - - /** destroy the managed ODE object */ - virtual void DestroyODEObjectImp(); - -protected: - /** creates them managed ODE world */ - virtual bool ConstructInternalImp(); - - // - // Members - // -private: - /** the dynamics world represented by this object */ - dWorldID mODEWorld; -}; - -DECLARE_CLASS(ODEWorld); - -}; - -#endif //OXYGEN_WORLD_H Copied: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h (from rev 101, trunk/spark/lib/oxygen/physicsserver/ode/odeworld.h) =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-18 07:24:29 UTC (rev 102) @@ -0,0 +1,124 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: world.h 56 2009-03-17 18:03:47Z hedayat $ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public Li... [truncated message content] |