From: <he...@us...> - 2009-11-18 00:29:32
|
Revision: 100 http://simspark.svn.sourceforge.net/simspark/?rev=100&view=rev Author: hedayat Date: 2009-11-18 00:29:17 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Merge changes from trunk to this branch Modified Paths: -------------- 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.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 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/spark/lib/oxygen/ Property changes on: branches/multiphys/spark/lib/oxygen ___________________________________________________________________ Added: svn:mergeinfo + /trunk/spark/lib/oxygen:95-99 Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-18 00:29:17 UTC (rev 100) @@ -22,6 +22,10 @@ physicsserver/collider.h physicsserver/boxcollider.h physicsserver/ccylindercollider.h + physicsserver/collider.h + physicsserver/collisionhandler.h + physicsserver/contactjointhandler.h + physicsserver/physicsserver.h physicsserver/planecollider.h physicsserver/spherecollider.h physicsserver/joint.h @@ -46,6 +50,15 @@ physicsserver/odewrapper.h physicsserver/odeobject.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 @@ -118,6 +131,14 @@ physicsserver/boxcollider_c.cpp physicsserver/ccylindercollider.cpp physicsserver/ccylindercollider_c.cpp + physicsserver/collider.cpp + physicsserver/collider_c.cpp + physicsserver/collisionhandler.cpp + physicsserver/collisionhandler_c.cpp + physicsserver/contactjointhandler.cpp + physicsserver/contactjointhandler_c.cpp + physicsserver/physicsserver.cpp + physicsserver/physicsserver_c.cpp physicsserver/planecollider.cpp physicsserver/planecollider_c.cpp physicsserver/spherecollider.cpp @@ -161,6 +182,16 @@ physicsserver/odeobject.cpp physicsserver/odeobject_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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-18 00:29:17 UTC (rev 100) @@ -55,11 +55,12 @@ zg.GetCore()->RegisterClassObject(new CLASS(PhysicsServer), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(PhysicsObject), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Body), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(Collider), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(BoxCollider), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(CCylinderCollider), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(PlaneCollider), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(SphereCollider), "oxygen/"); + 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(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/"); @@ -85,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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-18 00:29:17 UTC (rev 100) @@ -34,36 +34,39 @@ #include "gamecontrolserver/actionobject.h" #include "gamecontrolserver/behavior.h" -//general includes -#include <oxygen/physicsserver/physicsserver.h> -#include <oxygen/physicsserver/physicsobject.h> -#include <oxygen/physicsserver/body.h> -#include <oxygen/physicsserver/collider.h> -#include <oxygen/physicsserver/boxcollider.h> -#include <oxygen/physicsserver/ccylindercollider.h> -#include <oxygen/physicsserver/planecollider.h> -#include <oxygen/physicsserver/spherecollider.h> -#include <oxygen/physicsserver/joint.h> -#include <oxygen/physicsserver/balljoint.h> -#include <oxygen/physicsserver/hingejoint.h> -#include <oxygen/physicsserver/hinge2joint.h> -#include <oxygen/physicsserver/fixedjoint.h> -#include <oxygen/physicsserver/sliderjoint.h> -#include <oxygen/physicsserver/universaljoint.h> -#include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/world.h> -#include <oxygen/physicsserver/bodycontroller.h> -#include <oxygen/physicsserver/collisionhandler.h> -#include <oxygen/physicsserver/contactjointhandler.h> -#include <oxygen/physicsserver/dragcontroller.h> -#include <oxygen/physicsserver/recorderhandler.h> -#include <oxygen/physicsserver/transformcollider.h> -#include <oxygen/physicsserver/raycollider.h> -#include <oxygen/physicsserver/velocitycontroller.h> +//abstract physics classes +#include "physicsserver/body.h" +#include "physicsserver/bodycontroller.h" +#include "physicsserver/dragcontroller.h" +#include "physicsserver/velocitycontroller.h" +#include "physicsserver/transformcollider.h" +#include "physicsserver/boxcollider.h" +#include "physicsserver/ccylindercollider.h" +#include "physicsserver/collider.h" +#include "physicsserver/physicsserver.h" +#include "physicsserver/planecollider.h" +#include "physicsserver/raycollider.h" +#include "physicsserver/space.h" +#include "physicsserver/spherecollider.h" +#include "physicsserver/world.h" +#include "physicsserver/collisionhandler.h" +#include "physicsserver/contactjointhandler.h" +#include "physicsserver/recorderhandler.h" +#include "physicsserver/joint.h" +#include "physicsserver/balljoint.h" +#include "physicsserver/hingejoint.h" +#include "physicsserver/fixedjoint.h" +#include "physicsserver/sliderjoint.h" +#include "physicsserver/universaljoint.h" +#include "physicsserver/hinge2joint.h" -//ODE-specific includes -#include <oxygen/physicsserver/odeobject.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.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldimp_c.cpp 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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-17 11:29:29 UTC (rev 99) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-18 00:29:17 UTC (rev 100) @@ -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 99, 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 00:29:17 UTC (rev 100) @@ -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 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 DestroyODEObjec... [truncated message content] |
From: <a-...@us...> - 2009-11-19 06:49:34
|
Revision: 104 http://simspark.svn.sourceforge.net/simspark/?rev=104&view=rev Author: a-held Date: 2009-11-19 06:49:26 +0000 (Thu, 19 Nov 2009) Log Message: ----------- removed unnecessary Imp suffixes and redundant documentation changed name of Imp folder to Int (since they are INTerfaces) prepared bridge pattern for spaces Modified Paths: -------------- 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/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp branches/multiphys/spark/lib/oxygen/physicsserver/world.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/imp/ branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint.h branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint.h branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/imp/ Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-19 06:49:26 UTC (rev 104) @@ -41,7 +41,7 @@ physicsserver/angularmotor.h #interfaces - physicsserver/imp/worldimp.h + physicsserver/int/worldint.h #ode-specific files physicsserver/ode/odeobject.h @@ -159,9 +159,12 @@ physicsserver/angularmotor_c.cpp #interfaces - physicsserver/imp/worldimp_c.cpp + physicsserver/int/worldint_c.cpp + physicsserver/int/spaceint_c.cpp #ODE-specific files + physicsserver/ode/odespace.cpp + physicsserver/ode/odespace_c.cpp physicsserver/ode/odeworld.cpp physicsserver/ode/odeworld_c.cpp physicsserver/ode/odeobject.cpp Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -59,7 +59,6 @@ zg.GetCore()->RegisterClassObject(new CLASS(VelocityController), "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/"); @@ -89,7 +88,6 @@ //ODE-specific classes zg.GetCore()->RegisterClassObject(new CLASS(ODEObject), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ODEWorld), "oxygen/"); #ifdef HAVE_SPADES_HEADERS Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-19 06:49:26 UTC (rev 104) @@ -60,12 +60,8 @@ #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" Added: branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint.h 2009-11-19 06:49:26 UTC (rev 104) @@ -0,0 +1,68 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_SPACEINT_H +#define OXYGEN_SPACEINT_H + +#include <oxygen/physicsserver/ode/odeobject.h> +#include <set> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ +class Transform; +class Body; +class Collider; + +class OXYGEN_API SpaceInt : public ODEObject +{ + +public: + typedef std::set<dSpaceID> TSpaceIdSet; + + SpaceInt() : ODEObject(){}; + virtual ~SpaceInt(){}; + + //virtual void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) = 0; + virtual dSpaceID GetODESpace() const = 0; + virtual dJointGroupID GetODEJointGroup() const = 0; + virtual void Collide() = 0; + virtual void DestroyODEObject() = 0; + virtual dSpaceID GetParentSpaceID() = 0; + virtual bool IsGlobalSpace() = 0; + virtual void DisableInnerCollision(bool disable) = 0; + virtual bool GetDisableInnerCollision() const = 0; + virtual void OnUnlink() = 0; + virtual void OnLink() = 0; + virtual void Collide(dSpaceID space) = 0; + virtual void HandleCollide(dGeomID obj1, dGeomID obj2) = 0; + virtual void HandleSpaceCollide(dGeomID obj1, dGeomID obj2) = 0; + virtual bool ConstructInternal() = 0; + virtual void PostPhysicsUpdateInternal() = 0; + virtual void DestroySpaceObjects() = 0; +}; + +DECLARE_ABSTRACTCLASS(SpaceInt); + +} //namespace oxygen + +#endif //OXYGEN_SPACEINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/spaceint_c.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -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/int/spaceint.h> + +using namespace oxygen; + +void CLASS(SpaceInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/ODEObject); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint.h 2009-11-19 06:49:26 UTC (rev 104) @@ -0,0 +1,58 @@ +/* -*- 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_WORLDINT_H +#define OXYGEN_WORLDINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odeobject.h> + +namespace oxygen +{ + +class OXYGEN_API WorldInt : public ODEObject +{ + +public: + WorldInt() : ODEObject(){}; + virtual ~WorldInt(){}; + + virtual dWorldID GetODEWorld() const = 0; + virtual void SetGravity(const salt::Vector3f& gravity) = 0; + virtual salt::Vector3f GetGravity() const = 0; + virtual void SetERP(float erp) = 0; + virtual float GetERP() const = 0; + virtual void SetCFM(float cfm) = 0; + virtual float GetCFM() const = 0; + virtual void Step(float deltaTime) = 0; + virtual bool GetAutoDisableFlag() const = 0; + virtual void SetAutoDisableFlag(bool flag) = 0; + virtual void SetContactSurfaceLayer(float depth) = 0; + virtual float GetContactSurfaceLayer() const = 0; + virtual void DestroyODEObject() = 0; + virtual bool ConstructInternal() = 0; +}; + +DECLARE_ABSTRACTCLASS(WorldInt); + +} + +#endif //OXYGEN_WORLDINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/imp/worldint_c.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -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/int/worldint.h> + +using namespace oxygen; + +void CLASS(WorldInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/ODEObject); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -0,0 +1,332 @@ +/* -*- 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: space.cpp 80 2009-07-30 17:25:42Z 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/odespace.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/sceneserver/scene.h> +#include <zeitgeist/logserver/logserver.h> + +using namespace boost; +using namespace oxygen; + +/** set of spaces with disabled inner collision */ +ODESpace::TSpaceIdSet ODESpace::gDisabledInnerCollisionSet; + +//void ODESpace::collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) +//{ + // Space *space = (Space*)data; + // space->HandleCollide(obj1, obj2); +//} + +ODESpace::ODESpace() : SpaceInt(), mODESpace(0), mODEContactGroup(0) +{ +} + +ODESpace::~ODESpace() +{ +} + +dSpaceID ODESpace::GetODESpace() const +{ + return mODESpace; +} + +dJointGroupID ODESpace::GetODEJointGroup() const +{ + return mODEContactGroup; +} + +void ODESpace::Collide() +{ + // bind collision callback function to this object + Collide(mODESpace); +} + +void ODESpace::Collide(dSpaceID space) +{ + if (gDisabledInnerCollisionSet.find(space) == gDisabledInnerCollisionSet.end()) + { + //dSpaceCollide(space, this, Space::collisionNearCallback); + } +} + +void ODESpace::HandleSpaceCollide(dGeomID obj1, dGeomID obj2) +{ + // collide all geoms internal to the space(s) + //dSpaceCollide2 (obj1,obj2,this,&Space::collisionNearCallback); + + if (dGeomIsSpace (obj1)) + { + Collide((dSpaceID)obj1); + } + + if (dGeomIsSpace (obj2)) + { + Collide((dSpaceID)obj2); + } +} + +void ODESpace::HandleCollide(dGeomID obj1, dGeomID obj2) +{ + if ( + (dGeomIsSpace (obj1)) || + (dGeomIsSpace (obj2)) + ) + { + // colliding a space with something + HandleSpaceCollide(obj1, obj2); + return; + } + + // colliding two non-space geoms; reject collisions + // between bodies that are connected with joints + const dBodyID b1 = dGeomGetBody(obj1); + const dBodyID b2 = dGeomGetBody(obj2); + + if ( + (b1) && (b2) && + (dAreConnectedExcluding(b1,b2,dJointTypeContact)) + ) + { + return; + } + + // if obj1 and obj2 are in a space that disabled inner collision, + // reject the collision + const dSpaceID s1 = dGeomGetSpace(obj1); + const dSpaceID s2 = dGeomGetSpace(obj2); + + // NOTICE: this should not happen since it is checked in Collide(dSpaceID) +// if ( +// (s1 == s2) && +// (gDisabledInnerCollisionSet.find(s1) != gDisabledInnerCollisionSet.end()) +// ) +// { +// return; +// } + + + // if obj1 and obj2 are in the same space, and + // obj1 is in obj2's "mNotCollideWithSet" or ojb2 is in obj1's + // reject the collision + + // get shared pointers to the two corresponding Collider nodes first + shared_ptr<Collider> collider = Collider::GetCollider(obj1); + shared_ptr<Collider> collidee = Collider::GetCollider(obj2); + + if ( + (collider.get() == 0) || + (collidee.get() == 0) + ) + { + return; + } + + if (s1 == s2) + { + const oxygen::Collider::TColliderNameSet & collider_set = collider->GetNotCollideWithSet(); + const oxygen::Collider::TColliderNameSet & collidee_set = collidee->GetNotCollideWithSet(); + if ( + (collider_set.find(collidee->GetName()) != collider_set.end()) || + (collidee_set.find(collider->GetName()) != collidee_set.end()) + ) + { + return; + } + } + + // dSpaceCollide(), is guaranteed to pass all potentially + // intersecting geom pairs to the callback function, but depending + // on the internal algorithms used by the space it may also make + // mistakes and pass non-intersecting pairs. Thus we can not + // expect that dCollide() will return contacts for every pair + // passed to the callback. + static const int nContacts = 4; + static dContact contacts[nContacts]; + + int n = dCollide (obj1, obj2, nContacts, + &contacts[0].geom, sizeof(dContact)); + + if (n == 0) + { + return; + } + + + for (int i=0;i<n;++i) + { + // notify the collider nodes + collider->OnCollision(collidee,contacts[i],Collider::CT_DIRECT); + collidee->OnCollision(collider,contacts[i],Collider::CT_SYMMETRIC); + } +} + +void ODESpace::OnUnlink() +{ + DisableInnerCollision(false); + ODEObject::OnUnlink(); +} + +void ODESpace::OnLink() +{ + ODEObject::OnLink(); + + shared_ptr<Space> space = GetSpace(); + dSpaceID spaceId = 0; + + if (space.get() != 0) + { + spaceId = space->GetODESpace(); + } + + mODESpace = dHashSpaceCreate(spaceId); +} + +dSpaceID ODESpace::GetParentSpaceID() +{ + if (mODESpace == 0) + { + return 0; + } + + return dGeomGetSpace((dGeomID)mODESpace); +} + +bool ODESpace::IsGlobalSpace() +{ + return + ( + (mODESpace != 0) && + (GetParentSpaceID() == 0) + ); +} + +bool ODESpace::ConstructInternal() +{ + // create a joint group for the contacts + mODEContactGroup = dJointGroupCreate(0); + + return (mODEContactGroup != 0); +} + +void ODESpace::PostPhysicsUpdateInternal() +{ + // remove all contact joints + dJointGroupEmpty (mODEContactGroup); +} + +void ODESpace::DestroySpaceObjects() +{ + shared_ptr<Scene> scene = GetScene(); + if (scene.get() == 0) + { + return; + } + + TLeafList objects; + const bool recursive = true; + scene->ListChildrenSupportingClass<ODEObject>(objects, recursive); + + bool globalSpace = IsGlobalSpace(); + shared_ptr<Space> self = shared_static_cast<Space>(GetSelf().lock()); + + for ( + TLeafList::iterator iter = objects.begin(); + iter != objects.end(); + ++iter + ) + { + shared_ptr<ODEObject> object = shared_static_cast<ODEObject>(*iter); + if (object == self) + { + continue; + } + + // destroy objects registered to this space; the top level + // space object also destroy any other ODE object + const dSpaceID parentSpace = object->GetParentSpaceID(); + if ( + ( + (globalSpace) && + (parentSpace == 0) + ) || + (parentSpace == mODESpace) + ) + { + object->DestroyODEObject(); + } + } +} + +void ODESpace::DestroyODEObject() +{ + if (! mODESpace) + { + return; + } + + // make sure that all objects registered to this space are destroyed + // before this space. Any other order provokes a segfault in ODE. + DestroySpaceObjects(); + + if (mODEContactGroup) + { + dJointGroupDestroy(mODEContactGroup); + mODEContactGroup = 0; + } + + // release the ODE space + dSpaceDestroy(mODESpace); + mODESpace = 0; +} + +void ODESpace::DisableInnerCollision(bool disable) +{ + if (mODESpace == 0) + { + //assert(false); + return; + } + + if (disable) + { + gDisabledInnerCollisionSet.insert(mODESpace); + return; + } + + TSpaceIdSet::iterator iter = gDisabledInnerCollisionSet.find(mODESpace); + if (iter == gDisabledInnerCollisionSet.end()) + { + return; + } + + gDisabledInnerCollisionSet.erase(iter); +} + +bool ODESpace::GetDisableInnerCollision() const +{ + TSpaceIdSet::const_iterator iter + = gDisabledInnerCollisionSet.find(mODESpace); + + return (iter != gDisabledInnerCollisionSet.end()); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h 2009-11-19 06:49:26 UTC (rev 104) @@ -0,0 +1,74 @@ +/* -*- 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_ODESPACE_H +#define OXYGEN_ODESPACE_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/int/spaceint.h> + +namespace oxygen +{ + +class OXYGEN_API ODESpace : public SpaceInt +{ + +public: + typedef std::set<dSpaceID> TSpaceIdSet; + +public: + ODESpace(); + virtual ~ODESpace(); + + dSpaceID GetODESpace() const; + dJointGroupID GetODEJointGroup() const; + void Collide(); + virtual void DestroyODEObject(); + virtual dSpaceID GetParentSpaceID(); + bool IsGlobalSpace(); + void DisableInnerCollision(bool disable); + bool GetDisableInnerCollision() const; + + dSpaceID mODESpace; + +protected: + //void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2); + virtual void OnUnlink(); + virtual void OnLink(); + void Collide(dSpaceID space); + void HandleCollide(dGeomID obj1, dGeomID obj2); + void HandleSpaceCollide(dGeomID obj1, dGeomID obj2); + virtual bool ConstructInternal(); + virtual void PostPhysicsUpdateInternal(); + void DestroySpaceObjects(); + +private: + dJointGroupID mODEContactGroup; + +private: + static TSpaceIdSet gDisabledInnerCollisionSet; +}; + +DECLARE_CLASS(ODESpace); + +} + +#endif //OXYGEN_ODESPACE_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -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/ode/odespace.h> + +using namespace oxygen; + +void CLASS(ODESpace)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/SpaceInt); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -27,7 +27,7 @@ using namespace oxygen; using namespace salt; -ODEWorld::ODEWorld() : WorldImp(), mODEWorld(0) +ODEWorld::ODEWorld() : WorldInt(), mODEWorld(0) { } @@ -35,12 +35,12 @@ { } -dWorldID ODEWorld::GetODEWorldImp() const +dWorldID ODEWorld::GetODEWorld() const { return mODEWorld; } -void ODEWorld::SetGravityImp(const Vector3f& gravity) +void ODEWorld::SetGravity(const Vector3f& gravity) { dWorldSetGravity(mODEWorld, gravity.x(), @@ -49,59 +49,59 @@ ); } -salt::Vector3f ODEWorld::GetGravityImp() const +salt::Vector3f ODEWorld::GetGravity() const { dVector3 dGravity; dWorldGetGravity(mODEWorld,dGravity); return Vector3f(dGravity[0],dGravity[1],dGravity[2]); } -void ODEWorld::SetERPImp(float erp) +void ODEWorld::SetERP(float erp) { dWorldSetERP(mODEWorld, erp); } -float ODEWorld::GetERPImp() const +float ODEWorld::GetERP() const { return dWorldGetERP(mODEWorld); } -void ODEWorld::SetCFMImp(float cfm) +void ODEWorld::SetCFM(float cfm) { dWorldSetCFM(mODEWorld, cfm); } -float ODEWorld::GetCFMImp() const +float ODEWorld::GetCFM() const { return dWorldGetCFM(mODEWorld); } -void ODEWorld::StepImp(float deltaTime) +void ODEWorld::Step(float deltaTime) { dWorldStep(mODEWorld, deltaTime); } -bool ODEWorld::GetAutoDisableFlagImp() const +bool ODEWorld::GetAutoDisableFlag() const { return (dWorldGetAutoDisableFlag(mODEWorld) == 1); } -void ODEWorld::SetAutoDisableFlagImp(bool flag) +void ODEWorld::SetAutoDisableFlag(bool flag) { dWorldSetAutoDisableFlag(mODEWorld, static_cast<int>(flag)); } -void ODEWorld::SetContactSurfaceLayerImp(float depth) +void ODEWorld::SetContactSurfaceLayer(float depth) { dWorldSetContactSurfaceLayer(mODEWorld, depth); } -float ODEWorld::GetContactSurfaceLayerImp() const +float ODEWorld::GetContactSurfaceLayer() const { return dWorldGetContactSurfaceLayer(mODEWorld); } -bool ODEWorld::ConstructInternalImp() +bool ODEWorld::ConstructInternal() { // create an ode world mODEWorld = dWorldCreate(); @@ -109,7 +109,7 @@ return (mODEWorld != 0); } -void ODEWorld::DestroyODEObjectImp() +void ODEWorld::DestroyODEObject() { static bool recurseLock = false; if (recurseLock) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-19 06:49:26 UTC (rev 104) @@ -23,102 +23,41 @@ #define OXYGEN_ODEWORLD_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/imp/worldimp.h> +#include <oxygen/physicsserver/int/worldint.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 +class OXYGEN_API ODEWorld : public WorldInt { - // - // Functions - // + public: ODEWorld(); virtual ~ODEWorld(); - /** returns the ID of the managed ODE world */ - dWorldID GetODEWorldImp() const; + dWorldID GetODEWorld() const; + void SetGravity(const salt::Vector3f& gravity); + salt::Vector3f GetGravity() const; + void SetERP(float erp); + float GetERP() const; + void SetCFM(float cfm); + float GetCFM() const; + void Step(float deltaTime); + bool GetAutoDisableFlag() const; + void SetAutoDisableFlag(bool flag); + void SetContactSurfaceLayer(float depth); + float GetContactSurfaceLayer() const; + virtual void DestroyODEObject(); - /** 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(); + virtual bool ConstructInternal(); - // - // Members - // private: - /** the dynamics world represented by this object */ dWorldID mODEWorld; }; DECLARE_CLASS(ODEWorld); -}; +} -#endif //OXYGEN_WORLD_H +#endif //OXYGEN_ODEWORLD_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-19 06:49:26 UTC (rev 104) @@ -30,8 +30,7 @@ World::World() : ODEObject() { - shared_ptr<ODEWorld> odeworld(new ODEWorld()); - mWorldImp = (shared_dynamic_cast<WorldImp>(odeworld)); + mWorldImp = shared_ptr<ODEWorld>(new ODEWorld()); } World::~World() @@ -40,70 +39,70 @@ dWorldID World::GetODEWorld() const { - return mWorldImp->GetODEWorldImp(); + return mWorldImp->GetODEWorld(); } void World::SetGravity(const Vector3f& gravity) { - mWorldImp->SetGravityImp(gravity); + mWorldImp->SetGravity(gravity); } salt::Vector3f World::GetGravity() const { - return mWorldImp->GetGravityImp(); + return mWorldImp->GetGravity(); } void World::SetERP(float erp) { - mWorldImp->SetERPImp(erp); + mWorldImp->SetERP(erp); } float World::GetERP() const { - return mWorldImp->GetERPImp(); + return mWorldImp->GetERP(); } void World::SetCFM(float cfm) { - mWorldImp->SetCFMImp(cfm); + mWorldImp->SetCFM(cfm); } float World::GetCFM() const { - return mWorldImp->GetCFMImp(); + return mWorldImp->GetCFM(); } void World::Step(float deltaTime) { - mWorldImp->StepImp(deltaTime); + mWorldImp->Step(deltaTime); } bool World::GetAutoDisableFlag() const { - return mWorldImp->GetAutoDisableFlagImp(); + return mWorldImp->GetAutoDisableFlag(); } void World::SetAutoDisableFlag(bool flag) { - mWorldImp->SetAutoDisableFlagImp(flag); + mWorldImp->SetAutoDisableFlag(flag); } void World::SetContactSurfaceLayer(float depth) { - mWorldImp->SetContactSurfaceLayerImp(depth); + mWorldImp->SetContactSurfaceLayer(depth); } float World::GetContactSurfaceLayer() const { - return mWorldImp->GetContactSurfaceLayerImp(); + return mWorldImp->GetContactSurfaceLayer(); } bool World::ConstructInternal() { - return mWorldImp->ConstructInternalImp(); + return mWorldImp->ConstructInternal(); } void World::DestroyODEObject() { - mWorldImp->DestroyODEObjectImp(); + mWorldImp->DestroyODEObject(); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-18 07:42:23 UTC (rev 103) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-19 06:49:26 UTC (rev 104) @@ -28,7 +28,7 @@ namespace oxygen { -class WorldImp; +class WorldInt; class ODEWorld; /** World encapsulates an ODE world object. It is a container for @@ -116,7 +116,7 @@ // Members // private: - boost::shared_ptr<WorldImp> mWorldImp; + boost::shared_ptr<WorldInt> mWorldImp; }; DECLARE_CLASS(World); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-11-19 10:10:58
|
Revision: 106 http://simspark.svn.sourceforge.net/simspark/?rev=106&view=rev Author: a-held Date: 2009-11-19 10:10:50 +0000 (Thu, 19 Nov 2009) Log Message: ----------- implemented bridge pattern for at least some methods in the Space class replaced ODEObject with a neutrally named PhysicsObject class Modified Paths: -------------- 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/angularmotor.h branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp branches/multiphys/spark/lib/oxygen/physicsserver/body.h branches/multiphys/spark/lib/oxygen/physicsserver/body_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp branches/multiphys/spark/lib/oxygen/physicsserver/space.h branches/multiphys/spark/lib/oxygen/physicsserver/space_c.cpp 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 Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject_c.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-19 10:10:50 UTC (rev 106) @@ -14,6 +14,7 @@ gamecontrolserver/behavior.h oxygen.h oxygen_defines.h + physicsserver/physicsobject.h physicsserver/body.h physicsserver/bodycontroller.h physicsserver/boxcollider.h @@ -44,7 +45,6 @@ physicsserver/int/worldint.h #ode-specific files - physicsserver/ode/odeobject.h physicsserver/ode/odeworld.h physicsserver/ode/odewrapper.h @@ -107,6 +107,8 @@ gamecontrolserver/behavior.cpp gamecontrolserver/behavior_c.cpp oxygen.cpp + physicsserver/physicsobject.cpp + physicsserver/physicsobject_c.cpp physicsserver/body.cpp physicsserver/body_c.cpp physicsserver/bodycontroller.cpp @@ -167,8 +169,6 @@ physicsserver/ode/odespace_c.cpp 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 Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -53,6 +53,7 @@ // physics zg.GetCore()->RegisterClassObject(new CLASS(PhysicsServer), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(PhysicsObject), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Body), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(BodyController), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(DragController), "oxygen/"); @@ -85,10 +86,6 @@ 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/"); - #ifdef HAVE_SPADES_HEADERS // spades Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-19 10:10:50 UTC (rev 106) @@ -35,6 +35,7 @@ #include "gamecontrolserver/behavior.h" //abstract physics classes +#include <oxygen/physicsserver/physicsobject.h> #include "physicsserver/body.h" #include "physicsserver/bodycontroller.h" #include "physicsserver/dragcontroller.h" @@ -60,9 +61,6 @@ #include "physicsserver/universaljoint.h" #include "physicsserver/hinge2joint.h" -//ode-specific includes -#include <oxygen/physicsserver/ode/odeobject.h> - #include "sceneserver/basenode.h" #include "sceneserver/camera.h" #include "sceneserver/fpscontroller.h" Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2009-11-19 10:10:50 UTC (rev 106) @@ -21,7 +21,7 @@ #define OXYGEN_ANGULARMOTOR_H #include <oxygen/oxygen_defines.h> -#include "joint.h" +#include <oxygen/physicsserver/joint.h> namespace oxygen { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -30,7 +30,7 @@ using namespace salt; using namespace std; -Body::Body() : ODEObject(), mODEBody(0), mMassTrans(0,0,0), mMassTransformed(false) +Body::Body() : PhysicsObject(), mODEBody(0), mMassTrans(0,0,0), mMassTransformed(false) { } @@ -115,7 +115,7 @@ void Body::OnLink() { - ODEObject::OnLink(); + PhysicsObject::OnLink(); if (! CreateBody()) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-19 10:10:50 UTC (rev 106) @@ -23,7 +23,7 @@ #define OXYGEN_BODY_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> namespace oxygen { @@ -36,7 +36,7 @@ usually constant over time: Mass, Center of mass and Inertia matrix (mass distribution matrix) */ -class OXYGEN_API Body : public ODEObject +class OXYGEN_API Body : public PhysicsObject { // // Functions Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body_c.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -568,7 +568,7 @@ void CLASS(Body)::DefineClass() { - DEFINE_BASECLASS(oxygen/ODEObject); + DEFINE_BASECLASS(oxygen/PhysicsObject); DEFINE_FUNCTION(enable); DEFINE_FUNCTION(disable); DEFINE_FUNCTION(isEnabled); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -32,7 +32,7 @@ using namespace boost; using namespace std; -Collider::Collider() : ODEObject(), mODEGeom(0) +Collider::Collider() : PhysicsObject(), mODEGeom(0) { } @@ -42,7 +42,7 @@ void Collider::OnLink() { - ODEObject::OnLink(); + PhysicsObject::OnLink(); weak_ptr<Node> parent = GetParent(); @@ -95,7 +95,7 @@ void Collider::OnUnlink() { - ODEObject::OnUnlink(); + PhysicsObject::OnUnlink(); // remove collision geometry from space dSpaceID space = GetParentSpaceID(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-19 10:10:50 UTC (rev 106) @@ -22,7 +22,7 @@ #ifndef OXYGEN_COLLIDER_H #define OXYGEN_COLLIDER_H -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> #include <string> #include <set> #include <oxygen/oxygen_defines.h> @@ -42,7 +42,7 @@ bodies. A body and a geom together represent all the properties of the simulated object. */ -class OXYGEN_API Collider : public ODEObject +class OXYGEN_API Collider : public PhysicsObject { // // Functions Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -104,10 +104,10 @@ void CLASS(Collider)::DefineClass() { + DEFINE_BASECLASS(oxygen/PhysicsObject); DEFINE_FUNCTION(setPosition); DEFINE_FUNCTION(setLocalPosition); DEFINE_FUNCTION(setRotation); DEFINE_FUNCTION(addCollisionHandler); DEFINE_FUNCTION(addNotCollideWithColliderName); - DEFINE_BASECLASS(oxygen/ODEObject); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h 2009-11-19 10:10:50 UTC (rev 106) @@ -23,7 +23,7 @@ #ifndef OXYGEN_SPACEINT_H #define OXYGEN_SPACEINT_H -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> #include <set> #include <oxygen/oxygen_defines.h> @@ -33,20 +33,20 @@ class Body; class Collider; -class OXYGEN_API SpaceInt : public ODEObject +class OXYGEN_API SpaceInt : public PhysicsObject { public: typedef std::set<dSpaceID> TSpaceIdSet; - SpaceInt() : ODEObject(){}; + SpaceInt() : PhysicsObject(){}; virtual ~SpaceInt(){}; //virtual void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) = 0; virtual dSpaceID GetODESpace() const = 0; virtual dJointGroupID GetODEJointGroup() const = 0; virtual void Collide() = 0; - virtual void DestroyODEObject() = 0; + virtual void DestroyPhysicsObject() = 0; virtual dSpaceID GetParentSpaceID() = 0; virtual bool IsGlobalSpace() = 0; virtual void DisableInnerCollision(bool disable) = 0; @@ -59,6 +59,8 @@ virtual bool ConstructInternal() = 0; virtual void PostPhysicsUpdateInternal() = 0; virtual void DestroySpaceObjects() = 0; + + boost::shared_ptr<Scene> scene; }; DECLARE_ABSTRACTCLASS(SpaceInt); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -27,7 +27,7 @@ using namespace salt; Joint::Joint() : -ODEObject(), mODEJoint(0), +PhysicsObject(), mODEJoint(0), mJointMaxSpeed1(0), mJointMaxSpeed2(0), mIsLimitJointMaxSpeed1(false), mIsLimitJointMaxSpeed2(false) { @@ -431,7 +431,7 @@ return GetParameter(dParamFMax + (idx * dParamGroup)); } -void Joint::DestroyODEObject() +void Joint::DestroyPhysicsObject() { if (! mODEJoint) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-11-19 10:10:50 UTC (rev 106) @@ -23,7 +23,7 @@ #define OXYGEN_JOINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> namespace oxygen { @@ -47,7 +47,7 @@ rates) directly, instead you must set the corresponding body positions and velocities. */ -class OXYGEN_API Joint : public ODEObject +class OXYGEN_API Joint : public PhysicsObject { public: enum EBodyIndex @@ -67,7 +67,7 @@ virtual ~Joint(); /** destroy the managed ODE object */ - virtual void DestroyODEObject(); + virtual void DestroyPhysicsObject(); /** attaches the joint to some new bodies. If the joint is already attached, it will be detached from the old bodies first. To Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint_c.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -547,7 +547,7 @@ void CLASS(Joint)::DefineClass() { - DEFINE_BASECLASS(oxygen/ODEObject); + DEFINE_BASECLASS(oxygen/PhysicsObject); DEFINE_FUNCTION(attach); DEFINE_FUNCTION(setHighStopDeg); DEFINE_FUNCTION(getHighStopDeg); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-19 10:10:50 UTC (rev 106) @@ -40,23 +40,23 @@ // // Functions // - ODEObject(); - virtual ~ODEObject(); + 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(); + virtual void OnUnlink(){}; /** returns the ODE world handle */ - dWorldID GetWorldID(); + dWorldID GetWorldID(){}; /** returns the nearest parent space ODE handle */ - dSpaceID FindSpaceID(); + dSpaceID FindSpaceID(){}; /** returns the ODE handle ID of the containing parent space */ - virtual dSpaceID GetParentSpaceID(); + virtual dSpaceID GetParentSpaceID(){}; /** destroy the managed ODE object */ virtual void DestroyODEObject(){}; @@ -66,7 +66,7 @@ boost::shared_ptr<World> GetWorld(); /** finds the nearest parent space node */ - boost::shared_ptr<Space> GetSpace(); + boost::shared_ptr<Space> GetSpace(){}; /** converts the rotation part of a salt::Matrix to an ODE dMatrix3 */ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -184,12 +184,12 @@ void ODESpace::OnUnlink() { DisableInnerCollision(false); - ODEObject::OnUnlink(); + PhysicsObject::OnUnlink(); } void ODESpace::OnLink() { - ODEObject::OnLink(); + PhysicsObject::OnLink(); shared_ptr<Space> space = GetSpace(); dSpaceID spaceId = 0; @@ -237,7 +237,6 @@ void ODESpace::DestroySpaceObjects() { - shared_ptr<Scene> scene = GetScene(); if (scene.get() == 0) { return; @@ -245,7 +244,7 @@ TLeafList objects; const bool recursive = true; - scene->ListChildrenSupportingClass<ODEObject>(objects, recursive); + scene->ListChildrenSupportingClass<PhysicsObject>(objects, recursive); bool globalSpace = IsGlobalSpace(); shared_ptr<Space> self = shared_static_cast<Space>(GetSelf().lock()); @@ -256,7 +255,7 @@ ++iter ) { - shared_ptr<ODEObject> object = shared_static_cast<ODEObject>(*iter); + shared_ptr<PhysicsObject> object = shared_static_cast<PhysicsObject>(*iter); if (object == self) { continue; @@ -273,12 +272,12 @@ (parentSpace == mODESpace) ) { - object->DestroyODEObject(); + object->DestroyPhysicsObject(); } } } -void ODESpace::DestroyODEObject() +void ODESpace::DestroyPhysicsObject() { if (! mODESpace) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h 2009-11-19 10:10:50 UTC (rev 106) @@ -41,7 +41,7 @@ dSpaceID GetODESpace() const; dJointGroupID GetODEJointGroup() const; void Collide(); - virtual void DestroyODEObject(); + virtual void DestroyPhysicsObject(); virtual dSpaceID GetParentSpaceID(); bool IsGlobalSpace(); void DisableInnerCollision(bool disable); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -122,7 +122,7 @@ shared_ptr<Space> space = GetSpace(); if (space.get() != 0) { - space->DestroyODEObject(); + space->DestroyPhysicsObject(); } if (mODEWorld == 0) Added: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -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/physicsobject.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; + +PhysicsObject::PhysicsObject() : BaseNode() +{ +} + +PhysicsObject::~PhysicsObject() +{ +} + +void PhysicsObject::OnUnlink() +{ + DestroyPhysicsObject(); +} + +/** returns the world node */ +shared_ptr<World> PhysicsObject::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> PhysicsObject::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 PhysicsObject::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 PhysicsObject::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 PhysicsObject::GetParentSpaceID() +{ + return 0; +} + +void PhysicsObject::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 PhysicsObject::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; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h 2009-11-19 10:10:50 UTC (rev 106) @@ -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_PHYSICSOBJECT_H +#define OXYGEN_PHYSICSOBJECT_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 PhysicsObject : public BaseNode +{ +public: + // + // Functions + // + PhysicsObject(); + virtual ~PhysicsObject(); + + /** 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 DestroyPhysicsObject(){}; + +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(PhysicsObject); + +} //namespace oxygen + +#endif //OXYGEN_PHYSICSOBJECT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -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/physicsobject.h> + +using namespace oxygen; + +void CLASS(PhysicsObject)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -19,9 +19,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "space.h" -#include "world.h" -#include "collider.h" +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/ode/odespace.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/world.h> #include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> @@ -37,8 +38,9 @@ space->HandleCollide(obj1, obj2); } -Space::Space() : ODEObject(), mODESpace(0), mODEContactGroup(0) +Space::Space() : PhysicsObject(), mODESpace(0) { + mSpaceImp = shared_ptr<ODESpace>(new ODESpace()); } Space::~Space() @@ -47,12 +49,12 @@ dSpaceID Space::GetODESpace() const { - return mODESpace; + return mSpaceImp->GetODESpace(); } dJointGroupID Space::GetODEJointGroup() const { - return mODEContactGroup; + return mSpaceImp->GetODEJointGroup(); } void Space::Collide() @@ -182,13 +184,13 @@ void Space::OnUnlink() { - DisableInnerCollision(false); - ODEObject::OnUnlink(); + mSpaceImp->DisableInnerCollision(false); + PhysicsObject::OnUnlink(); } void Space::OnLink() { - ODEObject::OnLink(); + PhysicsObject::OnLink(); shared_ptr<Space> space = GetSpace(); dSpaceID spaceId = 0; @@ -199,136 +201,49 @@ } mODESpace = dHashSpaceCreate(spaceId); + + shared_ptr<ODESpace> odespace = shared_static_cast<ODESpace>(mSpaceImp); + odespace->mODESpace = mODESpace; } dSpaceID Space::GetParentSpaceID() { - if (mODESpace == 0) - { - return 0; - } - - return dGeomGetSpace((dGeomID)mODESpace); + return mSpaceImp->GetParentSpaceID(); } bool Space::IsGlobalSpace() { - return - ( - (mODESpace != 0) && - (GetParentSpaceID() == 0) - ); + return mSpaceImp->IsGlobalSpace(); } bool Space::ConstructInternal() { - // create a joint group for the contacts - mODEContactGroup = dJointGroupCreate(0); - - return (mODEContactGroup != 0); + return mSpaceImp->ConstructInternal(); } void Space::PostPhysicsUpdateInternal() { - // remove all contact joints - dJointGroupEmpty (mODEContactGroup); + mSpaceImp->PostPhysicsUpdateInternal(); } -void -Space::DestroySpaceObjects() +void Space::DestroySpaceObjects() { - shared_ptr<Scene> scene = GetScene(); - if (scene.get() == 0) - { - return; - } - - TLeafList objects; - const bool recursive = true; - scene->ListChildrenSupportingClass<ODEObject>(objects, recursive); - - bool globalSpace = IsGlobalSpace(); - shared_ptr<Space> self = shared_static_cast<Space>(GetSelf().lock()); - - for ( - TLeafList::iterator iter = objects.begin(); - iter != objects.end(); - ++iter - ) - { - shared_ptr<ODEObject> object = shared_static_cast<ODEObject>(*iter); - if (object == self) - { - continue; - } - - // destroy objects registered to this space; the top level - // space object also destroy any other ODE object - const dSpaceID parentSpace = object->GetParentSpaceID(); - if ( - ( - (globalSpace) && - (parentSpace == 0) - ) || - (parentSpace == mODESpace) - ) - { - object->DestroyODEObject(); - } - } + mSpaceImp->scene = GetScene(); + + mSpaceImp->DestroySpaceObjects(); } -void -Space::DestroyODEObject() +void Space::DestroyPhysicsObject() { - if (! mODESpace) - { - return; - } - - // make sure that all objects registered to this space are destroyed - // before this space. Any other order provokes a segfault in ODE. - DestroySpaceObjects(); - - if (mODEContactGroup) - { - dJointGroupDestroy(mODEContactGroup); - mODEContactGroup = 0; - } - - // release the ODE space - dSpaceDestroy(mODESpace); - mODESpace = 0; + mSpaceImp->DestroyPhysicsObject(); } void Space::DisableInnerCollision(bool disable) { - if (mODESpace == 0) - { - //assert(false); - return; - } - - if (disable) - { - gDisabledInnerCollisionSet.insert(mODESpace); - return; - } - - TSpaceIdSet::iterator iter = gDisabledInnerCollisionSet.find(mODESpace); - if (iter == gDisabledInnerCollisionSet.end()) - { - return; - } - - gDisabledInnerCollisionSet.erase(iter); + mSpaceImp->DisableInnerCollision(disable); } bool Space::GetDisableInnerCollision() const { - TSpaceIdSet::const_iterator iter - = gDisabledInnerCollisionSet.find(mODESpace); - - return (iter != gDisabledInnerCollisionSet.end()); + return mSpaceImp->GetDisableInnerCollision(); } - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space.h 2009-11-19 10:10:50 UTC (rev 106) @@ -22,7 +22,7 @@ #ifndef OXYGEN_SPACE_H #define OXYGEN_SPACE_H -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> #include <set> #include <oxygen/oxygen_defines.h> @@ -31,13 +31,14 @@ class Transform; class Body; class Collider; +class SpaceInt; /** Space encapsulates an ODE space object. A space is a non-placeable geometry object ('geom') that can contain other geoms. It is similar to the rigid body concept of the `world', except that it applies to collision instead of dynamics. */ -class OXYGEN_API Space : public ODEObject +class OXYGEN_API Space : public PhysicsObject { public: typedef std::set<dSpaceID> TSpaceIdSet; @@ -61,7 +62,7 @@ void Collide(); /** destroy the managed ODE object */ - virtual void DestroyODEObject(); + virtual void DestroyPhysicsObject(); /** returns the ODE handle ID of the containing parent space */ virtual dSpaceID GetParentSpaceID(); @@ -115,12 +116,11 @@ // Members // private: + boost::shared_ptr<SpaceInt> mSpaceImp; + /** the managed ODE space */ dSpaceID mODESpace; - /** the ODE group for all created contact joints */ - dJointGroupID mODEContactGroup; - private: /** set of spaces with disabled inner collision */ static TSpaceIdSet gDisabledInnerCollisionSet; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space_c.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -38,6 +38,6 @@ void CLASS(Space)::DefineClass() { - DEFINE_BASECLASS(oxygen/ODEObject); + DEFINE_BASECLASS(oxygen/PhysicsObject); DEFINE_FUNCTION(disableInnerCollision); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -28,7 +28,7 @@ using namespace oxygen; using namespace salt; -World::World() : ODEObject() +World::World() : PhysicsObject() { mWorldImp = shared_ptr<ODEWorld>(new ODEWorld()); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-19 10:10:50 UTC (rev 106) @@ -23,7 +23,7 @@ #define OXYGEN_WORLD_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/physicsobject.h> namespace oxygen { @@ -38,7 +38,7 @@ time, thus one reason to use separate worlds is to simulate systems at different rates. */ -class OXYGEN_API World : public ODEObject +class OXYGEN_API World : public PhysicsObject { // // Functions Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world_c.cpp 2009-11-19 06:56:32 UTC (rev 105) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world_c.cpp 2009-11-19 10:10:50 UTC (rev 106) @@ -127,7 +127,7 @@ void CLASS(World)::DefineClass() { - DEFINE_BASECLASS(oxygen/ODEObject); + DEFINE_BASECLASS(oxygen/PhysicsObject); DEFINE_FUNCTION(setGravity); DEFINE_FUNCTION(setERP); DEFINE_FUNCTION(getERP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-11-25 10:20:20
|
Revision: 108 http://simspark.svn.sourceforge.net/simspark/?rev=108&view=rev Author: a-held Date: 2009-11-25 10:20:10 +0000 (Wed, 25 Nov 2009) Log Message: ----------- improved way for including files removed some unneeded class declarations in some header files completed the new inheritance tree Modified Paths: -------------- 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/angularmotor.cpp branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/balljoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/body.h branches/multiphys/spark/lib/oxygen/physicsserver/bodycontroller_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/dragcontroller_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/planecollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.h branches/multiphys/spark/lib/oxygen/physicsserver/raycollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/recorderhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/recorderhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/recorderhandler_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/velocitycontroller_c.cpp Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/conecollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h branches/multiphys/spark/lib/oxygen/physicsserver/softbody_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h branches/multiphys/spark/lib/oxygen/physicsserver/staticbody_c.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-25 10:20:10 UTC (rev 108) @@ -17,12 +17,21 @@ physicsserver/physicsobject.h physicsserver/body.h physicsserver/rigidbody.h + physicsserver/staticbody.h + physicsserver/dynamicbody.h + physicsserver/softbody.h physicsserver/bodycontroller.h physicsserver/boxcollider.h physicsserver/ccylindercollider.h + physicsserver/cylindercollider.h physicsserver/collider.h + physicsserver/compoundcollider.h + physicsserver/concavecollider.h + physicsserver/conecollider.h + physicsserver/convexcollider.h physicsserver/collisionhandler.h physicsserver/contactjointhandler.h + physicsserver/emptycollider.h physicsserver/physicsserver.h physicsserver/planecollider.h physicsserver/raycollider.h @@ -34,7 +43,9 @@ physicsserver/dragcontroller.h physicsserver/velocitycontroller.h physicsserver/joint.h + physicsserver/generic6dofjoint.h physicsserver/balljoint.h + physicsserver/conetwistjoint.h physicsserver/hingejoint.h physicsserver/fixedjoint.h physicsserver/sliderjoint.h @@ -113,6 +124,9 @@ physicsserver/body_c.cpp physicsserver/rigidbody.cpp physicsserver/rigidbody_c.cpp + physicsserver/staticbody_c.cpp + physicsserver/dynamicbody_c.cpp + physicsserver/softbody_c.cpp physicsserver/bodycontroller.cpp physicsserver/bodycontroller_c.cpp physicsserver/transformcollider.cpp @@ -121,12 +135,18 @@ physicsserver/boxcollider_c.cpp physicsserver/ccylindercollider.cpp physicsserver/ccylindercollider_c.cpp + physicsserver/cylindercollider_c.cpp physicsserver/collider.cpp physicsserver/collider_c.cpp + physicsserver/compoundcollider_c.cpp + physicsserver/concavecollider_c.cpp + physicsserver/conecollider_c.cpp + physicsserver/convexcollider_c.cpp physicsserver/collisionhandler.cpp physicsserver/collisionhandler_c.cpp physicsserver/contactjointhandler.cpp physicsserver/contactjointhandler_c.cpp + physicsserver/emptycollider_c.cpp physicsserver/physicsserver.cpp physicsserver/physicsserver_c.cpp physicsserver/planecollider.cpp @@ -147,8 +167,10 @@ physicsserver/velocitycontroller_c.cpp physicsserver/joint.cpp physicsserver/joint_c.cpp + physicsserver/generic6dofjoint_c.cpp physicsserver/balljoint.cpp physicsserver/balljoint_c.cpp + physicsserver/conetwistjoint_c.cpp physicsserver/hingejoint.cpp physicsserver/hingejoint_c.cpp physicsserver/fixedjoint.cpp Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "oxygen.h" +#include <oxygen/oxygen.h> using namespace oxygen; using namespace zeitgeist; @@ -56,13 +56,18 @@ zg.GetCore()->RegisterClassObject(new CLASS(PhysicsObject), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Body), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(RigidBody), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(StaticBody), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(DynamicBody), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(SoftBody), "oxygen/"); 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(Space), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(World), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Joint), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(Generic6DOFJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(BallJoint), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConeTwistJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(HingeJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(FixedJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(SliderJoint), "oxygen/"); @@ -71,9 +76,15 @@ // collider zg.GetCore()->RegisterClassObject(new CLASS(Collider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(CompoundCollider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConcaveCollider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConeCollider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConvexCollider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(EmptyCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(TransformCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(BoxCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(CCylinderCollider), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(CylinderCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(PlaneCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(RayCollider), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(SphereCollider), "oxygen/"); Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2009-11-25 10:20:10 UTC (rev 108) @@ -22,78 +22,89 @@ #ifndef OXYGEN_OXYGEN_H #define OXYGEN_OXYGEN_H -#include "oxygen_defines.h" -#include "agentaspect/agentaspect.h" -#include "agentaspect/effector.h" -#include "agentaspect/perceptor.h" +#include <oxygen/oxygen_defines.h> +#include <oxygen/agentaspect/agentaspect.h> +#include <oxygen/agentaspect/effector.h> +#include <oxygen/agentaspect/perceptor.h> -#include "controlaspect/controlaspect.h" +#include <oxygen/controlaspect/controlaspect.h> -#include "gamecontrolserver/baseparser.h" -#include "gamecontrolserver/gamecontrolserver.h" -#include "gamecontrolserver/actionobject.h" -#include "gamecontrolserver/behavior.h" +#include <oxygen/gamecontrolserver/baseparser.h> +#include <oxygen/gamecontrolserver/gamecontrolserver.h> +#include <oxygen/gamecontrolserver/actionobject.h> +#include <oxygen/gamecontrolserver/behavior.h> //abstract physics classes #include <oxygen/physicsserver/physicsobject.h> -#include "physicsserver/body.h" -#include "physicsserver/rigidbody.h" -#include "physicsserver/bodycontroller.h" -#include "physicsserver/dragcontroller.h" -#include "physicsserver/velocitycontroller.h" -#include "physicsserver/transformcollider.h" -#include "physicsserver/boxcollider.h" -#include "physicsserver/ccylindercollider.h" -#include "physicsserver/collider.h" -#include "physicsserver/physicsserver.h" -#include "physicsserver/planecollider.h" -#include "physicsserver/raycollider.h" -#include "physicsserver/space.h" -#include "physicsserver/spherecollider.h" -#include "physicsserver/world.h" -#include "physicsserver/collisionhandler.h" -#include "physicsserver/contactjointhandler.h" -#include "physicsserver/recorderhandler.h" -#include "physicsserver/joint.h" -#include "physicsserver/balljoint.h" -#include "physicsserver/hingejoint.h" -#include "physicsserver/fixedjoint.h" -#include "physicsserver/sliderjoint.h" -#include "physicsserver/universaljoint.h" -#include "physicsserver/hinge2joint.h" +#include <oxygen/physicsserver/body.h> +#include <oxygen/physicsserver/rigidbody.h> +#include <oxygen/physicsserver/staticbody.h> +#include <oxygen/physicsserver/dynamicbody.h> +#include <oxygen/physicsserver/softbody.h> +#include <oxygen/physicsserver/bodycontroller.h> +#include <oxygen/physicsserver/dragcontroller.h> +#include <oxygen/physicsserver/velocitycontroller.h> +#include <oxygen/physicsserver/transformcollider.h> +#include <oxygen/physicsserver/boxcollider.h> +#include <oxygen/physicsserver/ccylindercollider.h> +#include <oxygen/physicsserver/cylindercollider.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/compoundcollider.h> +#include <oxygen/physicsserver/concavecollider.h> +#include <oxygen/physicsserver/conecollider.h> +#include <oxygen/physicsserver/convexcollider.h> +#include <oxygen/physicsserver/emptycollider.h> +#include <oxygen/physicsserver/physicsserver.h> +#include <oxygen/physicsserver/planecollider.h> +#include <oxygen/physicsserver/raycollider.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/spherecollider.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/collisionhandler.h> +#include <oxygen/physicsserver/contactjointhandler.h> +#include <oxygen/physicsserver/recorderhandler.h> +#include <oxygen/physicsserver/joint.h> +#include <oxygen/physicsserver/generic6dofjoint.h> +#include <oxygen/physicsserver/balljoint.h> +#include <oxygen/physicsserver/conetwistjoint.h> +#include <oxygen/physicsserver/hingejoint.h> +#include <oxygen/physicsserver/fixedjoint.h> +#include <oxygen/physicsserver/sliderjoint.h> +#include <oxygen/physicsserver/universaljoint.h> +#include <oxygen/physicsserver/hinge2joint.h> -#include "sceneserver/basenode.h" -#include "sceneserver/camera.h" -#include "sceneserver/fpscontroller.h" -#include "sceneserver/scene.h" -#include "sceneserver/sceneserver.h" -#include "sceneserver/transform.h" -#include "sceneserver/sceneimporter.h" +#include <oxygen/sceneserver/basenode.h> +#include <oxygen/sceneserver/camera.h> +#include <oxygen/sceneserver/fpscontroller.h> +#include <oxygen/sceneserver/scene.h> +#include <oxygen/sceneserver/sceneserver.h> +#include <oxygen/sceneserver/transform.h> +#include <oxygen/sceneserver/sceneimporter.h> -#include "simulationserver/simulationserver.h" -#include "simulationserver/simcontrolnode.h" -#include "simulationserver/netcontrol.h" -#include "simulationserver/netmessage.h" -#include "simulationserver/agentcontrol.h" -#include "simulationserver/monitorcontrol.h" -#include "simulationserver/monitorlogger.h" -#include "simulationserver/traincontrol.h" +#include <oxygen/simulationserver/simulationserver.h> +#include <oxygen/simulationserver/simcontrolnode.h> +#include <oxygen/simulationserver/netcontrol.h> +#include <oxygen/simulationserver/netmessage.h> +#include <oxygen/simulationserver/agentcontrol.h> +#include <oxygen/simulationserver/monitorcontrol.h> +#include <oxygen/simulationserver/monitorlogger.h> +#include <oxygen/simulationserver/traincontrol.h> -#include "geometryserver/geometryserver.h" -#include "geometryserver/meshexporter.h" -#include "geometryserver/meshimporter.h" -#include "geometryserver/stdmeshimporter.h" +#include <oxygen/geometryserver/geometryserver.h> +#include <oxygen/geometryserver/meshexporter.h> +#include <oxygen/geometryserver/meshimporter.h> +#include <oxygen/geometryserver/stdmeshimporter.h> #ifdef HAVE_SPADES_HEADERS -#include "spadesserver/spadesserver.h" -#include "spadesserver/paramreader.h" +#include <oxygen/spadesserver/spadesserver.h> +#include <oxygen/spadesserver/paramreader.h> #endif -#include "monitorserver/monitorserver.h" -#include "monitorserver/monitorsystem.h" -#include "monitorserver/custommonitor.h" -#include "monitorserver/monitoritem.h" -#include "monitorserver/monitorcmdparser.h" +#include <oxygen/monitorserver/monitorserver.h> +#include <oxygen/monitorserver/monitorsystem.h> +#include <oxygen/monitorserver/custommonitor.h> +#include <oxygen/monitorserver/monitoritem.h> +#include <oxygen/monitorserver/monitorcmdparser.h> // control aspect #include <zeitgeist/zeitgeist.h> Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "angularmotor.h" +#include <oxygen/physicsserver/angularmotor.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.h 2009-11-25 10:20:10 UTC (rev 108) @@ -25,7 +25,6 @@ namespace oxygen { -class RigidBody; /** An angular motor allows the relative angular velocities of two bodies to be controlled. The angular velocity can be controlled on Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "angularmotor.h" +#include <oxygen/physicsserver/angularmotor.h> using namespace boost; using namespace oxygen; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -17,13 +17,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "balljoint.h" +#include <oxygen/physicsserver/balljoint.h> using namespace oxygen; using namespace boost; using namespace salt; -BallJoint::BallJoint() : Joint() +BallJoint::BallJoint() : Generic6DOFJoint() { } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2009-11-25 10:20:10 UTC (rev 108) @@ -21,13 +21,12 @@ #define OXYGEN_BALLJOINT_H #include <oxygen/oxygen_defines.h> -#include "joint.h" +#include <oxygen/physicsserver/generic6dofjoint.h> namespace oxygen { -class RigidBody; -class OXYGEN_API BallJoint : public Joint +class OXYGEN_API BallJoint : public Generic6DOFJoint { public: BallJoint(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "balljoint.h" +#include <oxygen/physicsserver/balljoint.h> using namespace boost; using namespace oxygen; @@ -44,6 +44,6 @@ void CLASS(BallJoint)::DefineClass() { - DEFINE_BASECLASS(oxygen/Joint); + DEFINE_BASECLASS(oxygen/Generic6DOFJoint); DEFINE_FUNCTION(setAnchor); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-25 10:20:10 UTC (rev 108) @@ -26,6 +26,11 @@ namespace oxygen { +/** This is currently a placeholder class to comply with the + inheritance tree. Once a Body class other than RigidBody has + been implemented, common functionality should be moved to this + common base class to reduce the amount of redundant code. +*/ class OXYGEN_API Body : public PhysicsObject { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/bodycontroller_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/bodycontroller_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/bodycontroller_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "bodycontroller.h" +#include <oxygen/physicsserver/bodycontroller.h> using namespace boost; using namespace oxygen; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -20,12 +20,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "boxcollider.h" +#include <oxygen/physicsserver/boxcollider.h> using namespace oxygen; using namespace salt; -BoxCollider::BoxCollider() : Collider() +BoxCollider::BoxCollider() : ConvexCollider() { } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -23,14 +23,14 @@ #define OXYGEN_BOXCOLLIDER_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/convexcollider.h> namespace oxygen { /** BoxCollider encapsulates an ODE box geometry object. */ -class OXYGEN_API BoxCollider : public Collider +class OXYGEN_API BoxCollider : public ConvexCollider { // // Functions Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "boxcollider.h" +#include <oxygen/physicsserver/boxcollider.h> using namespace boost; using namespace oxygen; @@ -73,7 +73,7 @@ void CLASS(BoxCollider)::DefineClass() { - DEFINE_BASECLASS(oxygen/Collider); + DEFINE_BASECLASS(oxygen/ConvexCollider); DEFINE_FUNCTION(setBoxLengths); DEFINE_FUNCTION(getBoxLength); DEFINE_FUNCTION(getPointDepth); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,12 +19,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "ccylindercollider.h" +#include <oxygen/physicsserver/ccylindercollider.h> using namespace oxygen; using namespace salt; -CCylinderCollider::CCylinderCollider() : Collider() +CCylinderCollider::CCylinderCollider() : ConvexCollider() { } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -23,7 +23,7 @@ #define OXYGEN_CCYLINDERCOLLIDER_H #include <oxygen/oxygen_defines.h> -#include "collider.h" +#include <oxygen/physicsserver/convexcollider.h> namespace oxygen { @@ -33,7 +33,7 @@ half-sphere caps at its ends. This feature makes the internal collision detection code particularly fast and accurate. */ -class OXYGEN_API CCylinderCollider : public Collider +class OXYGEN_API CCylinderCollider : public ConvexCollider { // // Functions Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ccylindercollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "ccylindercollider.h" +#include <oxygen/physicsserver/ccylindercollider.h> using namespace oxygen; using namespace boost; @@ -102,7 +102,7 @@ void CLASS(CCylinderCollider)::DefineClass() { - DEFINE_BASECLASS(oxygen/Collider); + DEFINE_BASECLASS(oxygen/ConvexCollider); DEFINE_FUNCTION(setParams); DEFINE_FUNCTION(setRadius); DEFINE_FUNCTION(setLength); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -18,14 +18,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "collider.h" -#include "space.h" -#include "rigidbody.h" +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/collisionhandler.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/transformcollider.h> +#include <oxygen/physicsserver/rigidbody.h> +#include <oxygen/sceneserver/scene.h> #include <zeitgeist/leaf.h> -#include "collisionhandler.h" -#include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> -#include "transformcollider.h" using namespace oxygen; using namespace salt; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -23,14 +23,12 @@ #define OXYGEN_COLLIDER_H #include <oxygen/physicsserver/physicsobject.h> +#include <oxygen/oxygen_defines.h> #include <string> #include <set> -#include <oxygen/oxygen_defines.h> namespace oxygen { -class Space; -class World; /** \class Collider encapsulates an ODE geometry object- geom for short. Geoms are the fundamental objects in the collision Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "collider.h" +#include <oxygen/physicsserver/collider.h> using namespace oxygen; using namespace boost; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,12 +19,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "collisionhandler.h" -#include "world.h" -#include "space.h" -#include "collider.h" +#include <oxygen/physicsserver/collisionhandler.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> -#include <oxygen/sceneserver/scene.h> using namespace oxygen; using namespace boost; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collisionhandler_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "collisionhandler.h" +#include <oxygen/physicsserver/collisionhandler.h> using namespace oxygen; Added: branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_COMPOUNDCOLLIDER_H +#define OXYGEN_COMPOUNDCOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/collider.h> + +namespace oxygen +{ +/** + CompoundCollider is not yet implemented. +*/ + +class OXYGEN_API CompoundCollider : public Collider +{ + // + // Functions + // +public: + CompoundCollider() : Collider(){}; + virtual ~CompoundCollider(){}; +}; + +DECLARE_CLASS(CompoundCollider); + +} //namespace oxygen + +#endif //OXYGEN_COMPOUNDCOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/compoundcollider.h> + +using namespace oxygen; + +void CLASS(CompoundCollider)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Collider); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_CONCAVECOLLIDER_H +#define OXYGEN_CONCAVECOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/collider.h> + +namespace oxygen +{ +/** + ConcaveCollider is not yet implemented. +*/ + +class OXYGEN_API ConcaveCollider : public Collider +{ + // + // Functions + // +public: + ConcaveCollider() : Collider(){}; + virtual ~ConcaveCollider(){}; +}; + +DECLARE_CLASS(ConcaveCollider); + +} //namespace oxygen + +#endif //OXYGEN_CONCAVECOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/concavecollider.h> + +using namespace oxygen; + +void CLASS(ConcaveCollider)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Collider); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_CONECOLLIDER_H +#define OXYGEN_CONECOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/convexcollider.h> + +namespace oxygen +{ +/** + ConeCollider is not yet implemented. +*/ + +class OXYGEN_API ConeCollider : public ConvexCollider +{ + // + // Functions + // +public: + ConeCollider() : ConvexCollider(){}; + virtual ~ConeCollider(){}; +}; + +DECLARE_CLASS(ConeCollider); + +} //namespace oxygen + +#endif //OXYGEN_CONECOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/conecollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conecollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conecollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/conecollider.h> + +using namespace oxygen; + +void CLASS(ConeCollider)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/ConvexCollider); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,51 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_CONETWISTJOINT_H +#define OXYGEN_CONETWISTJOINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/generic6dofjoint.h> + +namespace oxygen +{ +/** + ConeTwistJoint is not yet implemented. +*/ + +class OXYGEN_API ConeTwistJoint : public Generic6DOFJoint +{ + +public: + ConeTwistJoint() : Generic6DOFJoint(){}; + virtual ~ConeTwistJoint(){}; + + //overwrite pure virtual methods inherited from Joint + //to shut the compiler up + void SetParameter(int parameter, float value){}; + float GetParameter(int parameter) const {}; +}; + +DECLARE_CLASS(ConeTwistJoint); + +} //namespace oxygen + +#endif //OXYGEN_CONETWISTJOINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/conetwistjoint.h> + +using namespace oxygen; + +void CLASS(ConeTwistJoint)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Generic6DOFJoint); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,11 +19,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "contactjointhandler.h" -#include "collider.h" -#include "world.h" -#include "space.h" - +#include <oxygen/physicsserver/contactjointhandler.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/world.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2009-11-25 10:20:10 UTC (rev 108) @@ -23,7 +23,7 @@ #define OXYGEN_CONTACTJOINTHANDLER_H #include <oxygen/oxygen_defines.h> -#include "collisionhandler.h" +#include <oxygen/physicsserver/collisionhandler.h> namespace oxygen { @@ -153,5 +153,4 @@ } //namespace oxygen - #endif // OXYGEN_CONTACTJOINTHANDLER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "contactjointhandler.h" +#include <oxygen/physicsserver/contactjointhandler.h> using namespace oxygen; Added: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,45 @@ +/* -*- 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: joint.h 107 2009-11-25 06:09:10Z a-held $ + + 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_CONVEXCOLLIDER_H +#define OXYGEN_CONVEXCOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/collider.h> + +namespace oxygen +{ +/** ConvexCollider is the common base class of all convex + geometry objects, such as spheres and boxes. +*/ + +class OXYGEN_API ConvexCollider : public Collider +{ +public: + ConvexCollider() : Collider(){}; + virtual ~ConvexCollider(){}; +}; + +DECLARE_ABSTRACTCLASS(ConvexCollider); + +} //namespace oxygen + +#endif //OXYGEN_CONVEXCOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/convexcollider.h> + +using namespace oxygen; + +void CLASS(ConvexCollider)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Collider); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_CYLINDERCOLLIDER_H +#define OXYGEN_CYLINDERCOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/convexcollider.h> + +namespace oxygen +{ +/** + CylinderCollider is not yet implemented. +*/ + +class OXYGEN_API CylinderCollider : public ConvexCollider +{ + // + // Functions + // +public: + CylinderCollider() : ConvexCollider(){}; + virtual ~CylinderCollider(){}; +}; + +DECLARE_CLASS(CylinderCollider); + +} //namespace oxygen + +#endif //OXYGEN_CYLINDERCOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/cylindercollider.h> + +using namespace oxygen; + +void CLASS(CylinderCollider)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/ConvexCollider); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/dragcontroller_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dragcontroller_c.cpp 2009-11-25 06:09:10 UTC (rev 107) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dragcontroller_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "dragcontroller.h" +#include <oxygen/physicsserver/dragcontroller.h> using namespace oxygen; Added: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_DYNAMICBODY_H +#define OXYGEN_DYNAMICBODY_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/body.h> + +namespace oxygen +{ +/** + DynamicBody is not yet implemented. +*/ + +class OXYGEN_API DynamicBody : public Body +{ + // + // Functions + // +public: + DynamicBody() : Body(){}; + virtual ~DynamicBody(){}; +}; + +DECLARE_CLASS(DynamicBody); + +} //namespace oxygen + +#endif //OXYGEN_DYNAMICBODY_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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/dynamicbody.h> + +using namespace oxygen; + +void CLASS(DynamicBody)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/Body); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h 2009-11-25 10:20:10 UTC (rev 108) @@ -0,0 +1,48 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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_EMPTYCOLLIDER_H +#define OXYGEN_EMPTYCOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/collider.h> + +namespace oxygen +{ +/** + EmptyCollider is not yet implemented. +*/ + +class OXYGEN_API EmptyCollider : public Collider +{ + // + // Functions + // +public: + EmptyCollider() : Collider(){}; + virtual ~EmptyCollider(){}; +}; + +DECLARE_CLASS(EmptyCollider); + +} //namespace oxygen + +#endif //OXYGEN_EMPTYCOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider_c.cpp 2009-11-25 10:20:10 UTC (rev 108) @@ -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 t... [truncated message content] |
From: <a-...@us...> - 2009-11-26 10:30:39
|
Revision: 109 http://simspark.svn.sourceforge.net/simspark/?rev=109&view=rev Author: a-held Date: 2009-11-26 10:30:24 +0000 (Thu, 26 Nov 2009) Log Message: ----------- implemented bridge Pattern for PhysicsServer and all but one method in PhysicsObject removed some unneeded files Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp branches/multiphys/spark/lib/oxygen/physicsserver/world.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.h Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_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/odespace_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-26 10:30:24 UTC (rev 109) @@ -54,9 +54,15 @@ physicsserver/angularmotor.h #interfaces + physicsserver/int/physicsobjectint.h + physicsserver/int/physicsserverint.h + physicsserver/int/spaceint.h physicsserver/int/worldint.h #ode-specific files + physicsserver/ode/odephysicsobject.h + physicsserver/ode/odephysicsserver.h + physicsserver/ode/odespace.h physicsserver/ode/odeworld.h physicsserver/ode/odewrapper.h @@ -184,15 +190,11 @@ physicsserver/angularmotor.cpp physicsserver/angularmotor_c.cpp - #interfaces - physicsserver/int/worldint_c.cpp - physicsserver/int/spaceint_c.cpp - #ODE-specific files + physicsserver/ode/odephysicsobject.cpp + physicsserver/ode/odephysicsserver.cpp physicsserver/ode/odespace.cpp - physicsserver/ode/odespace_c.cpp physicsserver/ode/odeworld.cpp - physicsserver/ode/odeworld_c.cpp sceneserver/basenode.cpp sceneserver/basenode_c.cpp Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -262,7 +262,7 @@ ) > 0; } -void Collider::DestroyODEObject() +void Collider::DestroyPhysicsObject() { if (! mODEGeom) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-11-26 10:30:24 UTC (rev 109) @@ -148,8 +148,8 @@ */ virtual void PrePhysicsUpdateInternal(float deltaTime); - /** destroy the managed ODE object */ - virtual void DestroyODEObject(); + /** destroy the managed physicsobject */ + virtual void DestroyPhysicsObject(); // // Members Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,57 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_PHYSICSOBJECTINT_H +#define OXYGEN_PHYSICSOBJECTINT_H + +#include <boost/smart_ptr/shared_ptr.hpp> +#include <oxygen/physicsserver/ode/odewrapper.h> +#include <oxygen/sceneserver/basenode.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ +class World; +class Space; + +class OXYGEN_API PhysicsObjectInt : public BaseNode +{ + +public: + PhysicsObjectInt(){}; + virtual ~PhysicsObjectInt(){}; + + virtual dWorldID GetWorldID() = 0; + virtual dSpaceID FindSpaceID() = 0; + virtual dSpaceID GetParentSpaceID() = 0; + virtual void ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix) = 0; + virtual void ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const = 0; + virtual void DestroyPhysicsObject() = 0; + + boost::shared_ptr<Scene> scene; + boost::shared_ptr<Space> space; + boost::shared_ptr<World> world; +}; + +} //namespace oxygen + +#endif //OXYGEN_PHYSICSOBJECTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint.h 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,41 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_PHYSICSSERVERINT_H +#define OXYGEN_PHYSICSSERVERINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API PhysicsServerInt +{ + +public: + PhysicsServerInt(){}; + virtual ~PhysicsServerInt(){}; +}; + +} //namespace oxygen + +#endif //OXYGEN_PHYSICSSERVERINT_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h 2009-11-26 10:30:24 UTC (rev 109) @@ -23,7 +23,7 @@ #ifndef OXYGEN_SPACEINT_H #define OXYGEN_SPACEINT_H -#include <oxygen/physicsserver/physicsobject.h> +#include <oxygen/physicsserver/ode/odephysicsobject.h> #include <set> #include <oxygen/oxygen_defines.h> @@ -33,13 +33,13 @@ class RigidBody; class Collider; -class OXYGEN_API SpaceInt : public PhysicsObject +class OXYGEN_API SpaceInt : public ODEPhysicsObject { public: typedef std::set<dSpaceID> TSpaceIdSet; - SpaceInt() : PhysicsObject(){}; + SpaceInt() : ODEPhysicsObject(){}; virtual ~SpaceInt(){}; //virtual void collisionNearCallback (void *data, dGeomID obj1, dGeomID obj2) = 0; @@ -63,8 +63,6 @@ boost::shared_ptr<Scene> scene; }; -DECLARE_ABSTRACTCLASS(SpaceInt); - } //namespace oxygen #endif //OXYGEN_SPACEINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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/int/spaceint.h> - -using namespace oxygen; - -void CLASS(SpaceInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/ODEObject); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h 2009-11-26 10:30:24 UTC (rev 109) @@ -23,16 +23,16 @@ #define OXYGEN_WORLDINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/physicsserver/ode/odeobject.h> +#include <oxygen/physicsserver/ode/odephysicsobject.h> namespace oxygen { -class OXYGEN_API WorldInt : public ODEObject +class OXYGEN_API WorldInt : public ODEPhysicsObject { public: - WorldInt() : ODEObject(){}; + WorldInt() : ODEPhysicsObject(){}; virtual ~WorldInt(){}; virtual dWorldID GetODEWorld() const = 0; @@ -47,12 +47,10 @@ virtual void SetAutoDisableFlag(bool flag) = 0; virtual void SetContactSurfaceLayer(float depth) = 0; virtual float GetContactSurfaceLayer() const = 0; - virtual void DestroyODEObject() = 0; + virtual void DestroyPhysicsObject() = 0; virtual bool ConstructInternal() = 0; }; -DECLARE_ABSTRACTCLASS(WorldInt); - } #endif //OXYGEN_WORLDINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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/int/worldint.h> - -using namespace oxygen; - -void CLASS(WorldInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/ODEObject); -} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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; -} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject.h 2009-11-26 10:30:24 UTC (rev 109) @@ -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 Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeobject_c.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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); -} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,112 @@ +/* -*- 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/odephysicsobject.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/sceneserver/scene.h> +#include <iostream> + +using namespace oxygen; +using namespace boost; +using namespace std; + +ODEPhysicsObject::ODEPhysicsObject() : PhysicsObjectInt() +{ +} + +ODEPhysicsObject::~ODEPhysicsObject() +{ +} + +dWorldID ODEPhysicsObject::GetWorldID() +{ + if (world.get() == 0) + { + return 0; + } + + dWorldID worldId = world->GetODEWorld(); + if (worldId == 0) + { + cerr << "(ODEObject) ERROR: World returned empty ODE handle\n"; + } + + return worldId; +} + +dSpaceID ODEPhysicsObject::FindSpaceID() +{ + if (space.get() == 0) + { + return 0; + } + + dSpaceID spaceId = space->GetODESpace(); + + if (spaceId == 0) + { + cerr << "(ODEObject) ERROR: Space returned empty ODE handle\n"; + } + + return spaceId; +} + +dSpaceID ODEPhysicsObject::GetParentSpaceID() +{ + return 0; +} + +void ODEPhysicsObject::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 ODEPhysicsObject::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; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,53 @@ +/* -*- 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/physicsserver/int/physicsobjectint.h> +#include <oxygen/physicsserver/ode/odewrapper.h> + +namespace oxygen +{ +class Space; +class World; + +class OXYGEN_API ODEPhysicsObject : public PhysicsObjectInt +{ +public: + ODEPhysicsObject(); + virtual ~ODEPhysicsObject(); + + dWorldID GetWorldID(); + dSpaceID FindSpaceID(); + virtual dSpaceID GetParentSpaceID(); + virtual void DestroyPhysicsObject(){}; + +protected: + void ConvertRotationMatrix(const salt::Matrix& rot, dMatrix3& matrix); + void ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const; +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEPHYSICSOBJECT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,33 @@ +/* -*- 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: space.cpp 80 2009-07-30 17:25:42Z 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/odewrapper.h> +#include <oxygen/physicsserver/ode/odephysicsserver.h> + +using namespace oxygen; + +ODEPhysicsServer::ODEPhysicsServer(){ + dInitODE(); +} + +ODEPhysicsServer::~ODEPhysicsServer(){ + dCloseODE(); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsserver.h 2009-11-26 10:30:24 UTC (rev 109) @@ -0,0 +1,41 @@ +/* -*- 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_ODEPHYSICSSERVER_H +#define OXYGEN_ODEPHYSICSSERVER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/int/physicsserverint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEPhysicsServer : public PhysicsServerInt +{ +public: + ODEPhysicsServer(); + virtual ~ODEPhysicsServer(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEPHYSICSSERVER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -184,14 +184,14 @@ void ODESpace::OnUnlink() { DisableInnerCollision(false); - PhysicsObject::OnUnlink(); + ODEPhysicsObject::OnUnlink(); } void ODESpace::OnLink() { - PhysicsObject::OnLink(); + ODEPhysicsObject::OnLink(); - shared_ptr<Space> space = GetSpace(); + //shared_ptr<Space> space = GetSpace(); dSpaceID spaceId = 0; if (space.get() != 0) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.h 2009-11-26 10:30:24 UTC (rev 109) @@ -67,8 +67,6 @@ static TSpaceIdSet gDisabledInnerCollisionSet; }; -DECLARE_CLASS(ODESpace); - } #endif //OXYGEN_ODESPACE_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace_c.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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/ode/odespace.h> - -using namespace oxygen; - -void CLASS(ODESpace)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/SpaceInt); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -109,7 +109,7 @@ return (mODEWorld != 0); } -void ODEWorld::DestroyODEObject() +void ODEWorld::DestroyPhysicsObject() { static bool recurseLock = false; if (recurseLock) @@ -119,7 +119,7 @@ recurseLock = true; - shared_ptr<Space> space = GetSpace(); + //shared_ptr<Space> space = GetSpace(); if (space.get() != 0) { space->DestroyPhysicsObject(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld.h 2009-11-26 10:30:24 UTC (rev 109) @@ -47,7 +47,7 @@ void SetAutoDisableFlag(bool flag); void SetContactSurfaceLayer(float depth); float GetContactSurfaceLayer() const; - virtual void DestroyODEObject(); + virtual void DestroyPhysicsObject(); protected: virtual bool ConstructInternal(); @@ -56,8 +56,6 @@ dWorldID mODEWorld; }; -DECLARE_CLASS(ODEWorld); - } #endif //OXYGEN_ODEWORLD_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeworld_c.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -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/ode/odeworld.h> - -using namespace oxygen; - -void CLASS(ODEWorld)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/WorldImp); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -19,9 +19,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #include <oxygen/physicsserver/physicsobject.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/ode/odephysicsobject.h> #include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> @@ -30,6 +32,7 @@ PhysicsObject::PhysicsObject() : BaseNode() { + mPhysicsObjectImp = shared_ptr<ODEPhysicsObject>(new ODEPhysicsObject()); } PhysicsObject::~PhysicsObject() @@ -38,7 +41,7 @@ void PhysicsObject::OnUnlink() { - DestroyPhysicsObject(); + mPhysicsObjectImp->DestroyPhysicsObject(); } /** returns the world node */ @@ -90,7 +93,11 @@ dWorldID PhysicsObject::GetWorldID() { + mPhysicsObjectImp->world = GetWorld(); + shared_ptr<World> world = GetWorld(); + + //mPhysicsObjectImp->GetWorld(); if (world.get() == 0) { return 0; @@ -108,60 +115,22 @@ dSpaceID PhysicsObject::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; + mPhysicsObjectImp->space = GetSpace(); + + return mPhysicsObjectImp->FindSpaceID(); } dSpaceID PhysicsObject::GetParentSpaceID() { - return 0; + return mPhysicsObjectImp->GetParentSpaceID(); } void PhysicsObject::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; + mPhysicsObjectImp->ConvertRotationMatrix(rot, matrix); } void PhysicsObject::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; + mPhysicsObjectImp->ConvertRotationMatrix(matrix, rot); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h 2009-11-26 10:30:24 UTC (rev 109) @@ -31,6 +31,7 @@ { class Space; class World; +class PhysicsObjectInt; /** ODEObject is the base of all classes encapsulating ODE concepts */ @@ -57,8 +58,12 @@ /** returns the ODE handle ID of the containing parent space */ virtual dSpaceID GetParentSpaceID(); - - /** destroy the managed ODE object */ + + /** this method is not implemented here because PhysicsObject is an + abstract class. However, it is declared here so that it can be + called as a member of this class, which is necessary in some + cases (like destroying all objects in a space, where bodies, + colliders and joints have to be treated in one go).*/ virtual void DestroyPhysicsObject(){}; protected: @@ -74,6 +79,9 @@ /** coverts the ODE dMatrix3 to the rotation part of a salt::Matrix */ void ConvertRotationMatrix(const dReal* matrix, salt::Matrix& rot) const; + +private: + boost::shared_ptr<PhysicsObjectInt> mPhysicsObjectImp; }; DECLARE_ABSTRACTCLASS(PhysicsObject); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -20,17 +20,11 @@ */ #include <oxygen/physicsserver/physicsserver.h> +#include <oxygen/physicsserver/ode/odephysicsserver.h> using namespace oxygen; -PhysicsServer::PhysicsServer() - : Leaf() +PhysicsServer::PhysicsServer() : Leaf() { - dInitODE(); + mPhysicsServerImp = boost::shared_ptr<ODEPhysicsServer>(new ODEPhysicsServer()); } - -PhysicsServer::~PhysicsServer() -{ - // release memory associated with ode - dCloseODE(); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2009-11-26 10:30:24 UTC (rev 109) @@ -29,6 +29,7 @@ namespace oxygen { +class PhysicsServerInt; class OXYGEN_API PhysicsServer : public zeitgeist::Leaf { @@ -37,7 +38,10 @@ // public: PhysicsServer(); - ~PhysicsServer(); + virtual ~PhysicsServer(){}; + +private: + boost::shared_ptr<PhysicsServerInt> mPhysicsServerImp; }; DECLARE_CLASS(PhysicsServer); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -102,7 +102,7 @@ return true; } -void RigidBody::DestroyODEObject() +void RigidBody::DestroyPhysicsObject() { if (mODEBody == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h 2009-11-26 10:30:24 UTC (rev 109) @@ -226,8 +226,8 @@ /** returns the current poosition of this body */ salt::Vector3f GetPosition() const; - /** destroy the managed ODE object */ - virtual void DestroyODEObject(); + /** destroy the managed physicsobject */ + virtual void DestroyPhysicsObject(); /** synchronize parent node with the bodies position and orientation Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2009-11-26 10:30:24 UTC (rev 109) @@ -102,7 +102,7 @@ return mWorldImp->ConstructInternal(); } -void World::DestroyODEObject() +void World::DestroyPhysicsObject() { - mWorldImp->DestroyODEObject(); + mWorldImp->DestroyPhysicsObject(); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-25 10:20:10 UTC (rev 108) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.h 2009-11-26 10:30:24 UTC (rev 109) @@ -106,7 +106,7 @@ float GetContactSurfaceLayer() const; /** destroy the managed ODE object */ - virtual void DestroyODEObject(); + virtual void DestroyPhysicsObject(); protected: /** creates them managed ODE world */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-11-30 08:31:13
|
Revision: 110 http://simspark.svn.sourceforge.net/simspark/?rev=110&view=rev Author: a-held Date: 2009-11-30 08:31:04 +0000 (Mon, 30 Nov 2009) Log Message: ----------- provided bridge pattern for all non-implemented body classes prepared bridge pattern for RigidBody class Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/body.h branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.h branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-11-30 08:31:04 UTC (rev 110) @@ -54,15 +54,25 @@ physicsserver/angularmotor.h #interfaces + physicsserver/int/bodyint.h + physicsserver/int/dynamicbodyint.h physicsserver/int/physicsobjectint.h physicsserver/int/physicsserverint.h + physicsserver/int/rigidbodyint.h + physicsserver/int/softbodyint.h physicsserver/int/spaceint.h + physicsserver/int/staticbodyint.h physicsserver/int/worldint.h #ode-specific files + physicsserver/ode/odebody.h + physicsserver/ode/odedynamicbody.h physicsserver/ode/odephysicsobject.h physicsserver/ode/odephysicsserver.h + physicsserver/ode/oderigidbody.h + physicsserver/ode/odesoftbody.h physicsserver/ode/odespace.h + physicsserver/ode/odestaticbody.h physicsserver/ode/odeworld.h physicsserver/ode/odewrapper.h @@ -127,11 +137,15 @@ oxygen.cpp physicsserver/physicsobject.cpp physicsserver/physicsobject_c.cpp + physicsserver/body.cpp physicsserver/body_c.cpp physicsserver/rigidbody.cpp physicsserver/rigidbody_c.cpp + physicsserver/staticbody.cpp physicsserver/staticbody_c.cpp + physicsserver/dynamicbody.cpp physicsserver/dynamicbody_c.cpp + physicsserver/softbody.cpp physicsserver/softbody_c.cpp physicsserver/bodycontroller.cpp physicsserver/bodycontroller_c.cpp @@ -191,9 +205,14 @@ physicsserver/angularmotor_c.cpp #ODE-specific files + physicsserver/ode/odebody.cpp + physicsserver/ode/odedynamicbody.cpp physicsserver/ode/odephysicsobject.cpp physicsserver/ode/odephysicsserver.cpp + physicsserver/ode/oderigidbody.cpp + physicsserver/ode/odesoftbody.cpp physicsserver/ode/odespace.cpp + physicsserver/ode/odestaticbody.cpp physicsserver/ode/odeworld.cpp sceneserver/basenode.cpp Added: branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 108 2009-11-25 10:20:10Z a-held $ + + 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/body.h> +#include <oxygen/physicsserver/ode/odebody.h> + +using namespace oxygen; + +Body::Body() : PhysicsObject(){ + mBodyImp = boost::shared_ptr<ODEBody>(new ODEBody()); +} + +Body::~Body(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.h 2009-11-30 08:31:04 UTC (rev 110) @@ -26,6 +26,8 @@ namespace oxygen { +class BodyInt; + /** This is currently a placeholder class to comply with the inheritance tree. Once a Body class other than RigidBody has been implemented, common functionality should be moved to this @@ -35,8 +37,10 @@ class OXYGEN_API Body : public PhysicsObject { public: - Body() : PhysicsObject(){}; - virtual ~Body (){}; + Body(); + virtual ~Body(); + + boost::shared_ptr<BodyInt> mBodyImp; }; DECLARE_CLASS(Body); Added: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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/dynamicbody.h> +#include <oxygen/physicsserver/ode/odedynamicbody.h> + +using namespace oxygen; + +DynamicBody::DynamicBody() : Body(){ + mDynamicBodyImp = boost::shared_ptr<ODEDynamicBody>(new ODEDynamicBody()); +} + +DynamicBody::~DynamicBody(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -27,6 +27,7 @@ namespace oxygen { +class DynamicBodyInt; /** DynamicBody is not yet implemented. */ @@ -37,8 +38,10 @@ // Functions // public: - DynamicBody() : Body(){}; - virtual ~DynamicBody(){}; + DynamicBody(); + virtual ~DynamicBody(); + + boost::shared_ptr<DynamicBodyInt> mDynamicBodyImp; }; DECLARE_CLASS(DynamicBody); Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,42 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_BODYINT_H +#define OXYGEN_BODYINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odephysicsobject.h> + +namespace oxygen +{ + +class OXYGEN_API BodyInt : public ODEPhysicsObject +{ + +public: + BodyInt() : ODEPhysicsObject(){}; + virtual ~BodyInt(){}; +}; + +} //namespace oxygen + +#endif //OXYGEN_BODYINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,42 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_DYNAMICBODYINT_H +#define OXYGEN_DYNAMICBODYINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odebody.h> + +namespace oxygen +{ + +class OXYGEN_API DynamicBodyInt : public ODEBody +{ + +public: + DynamicBodyInt() : ODEBody(){}; + virtual ~DynamicBodyInt(){}; +}; + +} //namespace oxygen + +#endif //OXYGEN_DYNAMICBODYINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,105 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_RIGIDBODYINT_H +#define OXYGEN_RIGIDBODYINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odebody.h> + +namespace oxygen +{ + +class OXYGEN_API RigidBodyInt : public ODEBody +{ + +public: + RigidBodyInt() : ODEBody(){}; + virtual ~RigidBodyInt(){}; + + virtual dBodyID GetODEBody() const = 0; + virtual void Enable() = 0; + virtual void Disable() = 0; + virtual bool IsEnabled() const = 0; + virtual void UseGravity(bool f) = 0; + virtual bool UsesGravity() const = 0; + virtual void SetMass(float mass) = 0; + virtual void SetMassParameters(const dMass& mass) = 0; + virtual float GetMass() const = 0; + virtual void GetMassParameters(dMass& mass) const = 0; + virtual void SetSphere(float density, float radius) = 0; + virtual void AddSphere(float density, float radius, const salt::Matrix& matrix) = 0; + virtual void SetSphereTotal(float total_mass, float radius) = 0; + virtual void AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix) = 0; + virtual void SetBox(float density, const salt::Vector3f& size) = 0; + virtual void AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix) = 0; + virtual void SetBoxTotal(float total_mass, const salt::Vector3f& size) = 0; + virtual void AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix) = 0; + virtual void SetCylinder(float density, float radius, float length) = 0; + virtual void AddCylinder(float density, float radius, float length, const salt::Matrix& matrix) = 0; + virtual void SetCylinderTotal(float total_mass, float radius, float length) = 0; + virtual void AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix) = 0; + virtual void SetCapsule(float density, float radius, float length) = 0; + virtual void AddCapsule(float density, float radius, float length, const salt::Matrix& matrix) = 0; + virtual void SetCapsuleTotal(float total_mass, float radius, float length) = 0; + virtual void AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix) = 0; + virtual void TranslateMass(const salt::Vector3f& v) = 0; + virtual salt::Vector3f GetVelocity() const = 0; + virtual void SetVelocity(const salt::Vector3f& vel) = 0; + virtual void SetRotation(const salt::Matrix& rot) = 0; + virtual salt::Matrix GetRotation() const = 0; + virtual salt::Vector3f GetAngularVelocity() const = 0; + virtual void SetAngularVelocity(const salt::Vector3f& vel) = 0; + virtual void AddForce(const salt::Vector3f& force) = 0; + virtual void AddTorque(const salt::Vector3f& torque) = 0; + virtual void SetPosition(const salt::Vector3f& pos) = 0; + virtual salt::Vector3f GetPosition() const = 0; + virtual void DestroyPhysicsObject() = 0; + virtual void SynchronizeParent() const = 0; + virtual void AddMass(const dMass& mass, const salt::Matrix& matrix) = 0; + //virtual salt::Vector3f GetMassCenter() const = 0; + +protected: + virtual void OnLink() = 0; + virtual bool CreateBody() = 0; + virtual void PrepareBoxTotal(dMass& mass, float total_mass, const salt::Vector3f& size) const = 0; + virtual void PrepareBox(dMass& mass, float density, const salt::Vector3f& size) const = 0; + virtual void PrepareSphere(dMass& mass, float density, float radius) const = 0; + virtual void PrepareSphereTotal(dMass& mass, float total_mass, float radius) const = 0; + virtual void PrepareCylinder(dMass& mass, float density, float radius, float length) const = 0; + virtual void PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const = 0; + virtual void PrepareCapsule(dMass& mass, float density, float radius, float length) const = 0; + virtual void PrepareCapsuleTotal(dMass& mass, float total_mass, float radius, float length) const = 0; + +private: + virtual void PrePhysicsUpdateInternal(float deltaTime) = 0; + virtual void PostPhysicsUpdateInternal() = 0; + +protected: + dBodyID mODEBody; + salt::Vector3f mMassTrans; + bool mMassTransformed; +}; + +} //namespace oxygen + +#endif //OXYGEN_RIGIDBODYINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,42 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_SOFTBODYINT_H +#define OXYGEN_SOFTBODYINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odebody.h> + +namespace oxygen +{ + +class OXYGEN_API SoftBodyInt : public ODEBody +{ + +public: + SoftBodyInt() : ODEBody(){}; + virtual ~SoftBodyInt(){}; +}; + +} //namespace oxygen + +#endif //OXYGEN_SOFTBODYINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,42 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_STATICBODYINT_H +#define OXYGEN_STATICBODYINT_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/ode/odebody.h> + +namespace oxygen +{ + +class OXYGEN_API StaticBodyInt : public ODEBody +{ + +public: + StaticBodyInt() : ODEBody(){}; + virtual ~StaticBodyInt(){}; +}; + +} //namespace oxygen + +#endif //OXYGEN_STATICBODYINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,32 @@ +/* -*- 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/odebody.h> + +using namespace oxygen; + +ODEBody::ODEBody() : BodyInt(){ + +} + +ODEBody::~ODEBody(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODEBODY_H +#define OXYGEN_ODEBODY_H + +#include <oxygen/physicsserver/int/bodyint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEBody : public BodyInt +{ +public: + ODEBody(); + virtual ~ODEBody(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEBODY_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,32 @@ +/* -*- 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/odedynamicbody.h> + +using namespace oxygen; + +ODEDynamicBody::ODEDynamicBody() : DynamicBodyInt(){ + +} + +ODEDynamicBody::~ODEDynamicBody(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odedynamicbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODEDYNAMICBODY_H +#define OXYGEN_ODEDYNAMICBODY_H + +#include <oxygen/physicsserver/int/dynamicbodyint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEDynamicBody : public DynamicBodyInt +{ +public: + ODEDynamicBody(); + virtual ~ODEDynamicBody(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEDYNAMICBODY_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,532 @@ +/* -*- 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/rigidbody.h> +#include <oxygen/physicsserver/transformcollider.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/ode/oderigidbody.h> +#include <oxygen/sceneserver/scene.h> +#include <oxygen/sceneserver/transform.h> +#include <zeitgeist/logserver/logserver.h> + +using namespace oxygen; +using namespace boost; +using namespace salt; +using namespace std; + +ODERigidBody::ODERigidBody() : RigidBodyInt(){ + +} + +ODERigidBody::~ODERigidBody(){ + +} + +dBodyID ODERigidBody::GetODEBody() const +{ + return mODEBody; +} + +void ODERigidBody::Enable() +{ + dBodyEnable(mODEBody); +} + +void ODERigidBody::Disable() +{ + dBodyDisable(mODEBody); +} + +bool ODERigidBody::IsEnabled() const +{ + return (dBodyIsEnabled(mODEBody) != 0); +} + +void ODERigidBody::UseGravity(bool f) +{ + if (f == true) + { + // body is affected by gravity + dBodySetGravityMode(mODEBody, 1); + } + else + { + // body is not affected by gravity + dBodySetGravityMode(mODEBody, 0); + } +} + +bool ODERigidBody::UsesGravity() const +{ + return (dBodyGetGravityMode(mODEBody) != 0); +} + +bool ODERigidBody::CreateBody() +{ + if (mODEBody != 0) + { + return true; + } + + dWorldID world = GetWorldID(); + if (world == 0) + { + return false; + } + + // create the managed body + mODEBody = dBodyCreate(world); + if (mODEBody == 0) + { + GetLog()->Error() + << "(Body) ERROR: could not create new ODE body\n"; + return false; + } + + return true; +} + +void ODERigidBody::DestroyPhysicsObject() +{ + if (mODEBody == 0) + { + return; + } + + dBodyDestroy(mODEBody); + mODEBody = 0; +} + +void ODERigidBody::OnLink() +{ + ODEPhysicsObject::OnLink(); + + if (! CreateBody()) + { + return; + } + + // let the body, take on the world space position of the parent + dBodySetData(mODEBody, this); + + shared_ptr<BaseNode> baseNode = shared_static_cast<BaseNode> + (GetParent().lock()); + + const Matrix& mat = baseNode->GetWorldTransform(); + SetRotation(mat); + SetPosition(mat.Pos()); +} + +void ODERigidBody::SetMass(float mass) +{ + dMass ODEMass; + dBodyGetMass(mODEBody, &ODEMass); + dMassAdjust(&ODEMass, mass); + dBodySetMass(mODEBody, &ODEMass); +} + +float ODERigidBody::GetMass() const +{ + dMass m; + dBodyGetMass(mODEBody, &m); + return m.mass; +} + +void ODERigidBody::GetMassParameters(dMass& mass) const +{ + dBodyGetMass(mODEBody, &mass); +} + +void ODERigidBody::SetMassParameters(const dMass& mass) +{ + dBodySetMass(mODEBody, &mass); +} + +void ODERigidBody::PrepareSphere(dMass& mass, float density, float radius) const +{ + dMassSetSphere(&mass, density, radius); +} + +void ODERigidBody::SetSphere(float density, float radius) +{ + dMass ODEMass; + PrepareSphere(ODEMass, density, radius); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddSphere(float density, float radius, const Matrix& matrix) +{ + dMass ODEMass; + PrepareSphere(ODEMass, density, radius); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareSphereTotal(dMass& mass, float total_mass, float radius) const +{ + dMassSetSphereTotal(&mass, total_mass, radius); +} + +void ODERigidBody::SetSphereTotal(float total_mass, float radius) +{ + dMass ODEMass; + PrepareSphereTotal(ODEMass, total_mass, radius); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddSphereTotal(float total_mass, float radius, const Matrix& matrix) +{ + dMass ODEMass; + PrepareSphereTotal(ODEMass, total_mass, radius); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareBox(dMass& mass, float density, const Vector3f& size) const +{ + dMassSetBox(&mass, density, size[0], size[1], size[2]); +} + +void ODERigidBody::SetBox(float density, const Vector3f& size) +{ + dMass ODEMass; + PrepareBox(ODEMass, density, size); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddBox(float density, const Vector3f& size, const Matrix& matrix) +{ + dMass ODEMass; + PrepareBox(ODEMass, density, size); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareBoxTotal(dMass& mass, float total_mass, const Vector3f& size) const +{ + dMassSetBoxTotal(&mass, total_mass, size[0], size[1], size[2]); +} + +void ODERigidBody::SetBoxTotal(float total_mass, const Vector3f& size) +{ + dMass ODEMass; + PrepareBoxTotal(ODEMass, total_mass, size); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddBoxTotal(float total_mass, const Vector3f& size, const Matrix& matrix) +{ + dMass ODEMass; + PrepareBoxTotal(ODEMass, total_mass, size); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::AddMass(const dMass& mass, const Matrix& matrix) +{ + dMass transMass(mass); + + dMatrix3 rot; + ConvertRotationMatrix(matrix, rot); + dMassRotate(&transMass,rot); + + const Vector3f& trans(matrix.Pos()); + dMassTranslate(&transMass,trans[0],trans[1],trans[2]); + + dMassTranslate(&transMass,mMassTrans[0],mMassTrans[1],mMassTrans[2]); + + dMass bodyMass; + dBodyGetMass(mODEBody, &bodyMass); + dMassAdd(&bodyMass, &transMass); + + /** ODE currently requires that the center mass is always in the + origin of the body + */ + Vector3f trans2(bodyMass.c[0], bodyMass.c[1], bodyMass.c[2]); + + dMassTranslate(&bodyMass, -trans2[0], -trans2[1], -trans2[2]); + bodyMass.c[0] = bodyMass.c[1] = bodyMass.c[2] = 0.0f; + dBodySetMass(mODEBody, (const dMass*)&bodyMass); + + // Move body so mass is at right position again + SetPosition(GetPosition() + trans2); + + // Keep track of total translation of mass + mMassTrans = mMassTrans - trans2; + + mMassTransformed = true; +} + +void ODERigidBody::PrepareCylinder (dMass& mass, float density, float radius, float length) const +{ + // direction: (1=x, 2=y, 3=z) + int direction = 3; + + dMassSetCylinder (&mass, density, direction, radius, length); +} + +void ODERigidBody::SetCylinder (float density, float radius, float length) +{ + dMass ODEMass; + PrepareCylinder(ODEMass, density, radius, length); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddCylinder (float density, float radius, float length, const Matrix& matrix) +{ + dMass ODEMass; + PrepareCylinder(ODEMass, density, radius, length); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const +{ + // direction: (1=x, 2=y, 3=z) + int direction = 3; + + dMassSetCylinderTotal(&mass, total_mass, direction, radius, length); +} + +void ODERigidBody::SetCylinderTotal(float total_mass, float radius, float length) +{ + dMass ODEMass; + PrepareCylinderTotal(ODEMass, total_mass, radius, length); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddCylinderTotal(float total_mass, float radius, float length, const Matrix& matrix) +{ + dMass ODEMass; + PrepareCylinderTotal(ODEMass, total_mass, radius, length); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareCapsule (dMass& mass, float density, float radius, float length) const +{ + // direction: (1=x, 2=y, 3=z) + int direction = 3; + + dMassSetCapsule (&mass, density, direction, radius, length); +} + +void ODERigidBody::SetCapsule (float density, float radius, float length) +{ + dMass ODEMass; + PrepareCapsule(ODEMass, density, radius, length); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddCapsule (float density, float radius, float length, const Matrix& matrix) +{ + dMass ODEMass; + PrepareCapsule(ODEMass, density, radius, length); + AddMass(ODEMass, matrix); +} + +void ODERigidBody::PrepareCapsuleTotal(dMass& mass, float total_mass, float radius, float length) const +{ + // direction: (1=x, 2=y, 3=z) + int direction = 3; + + dMassSetCapsuleTotal(&mass, total_mass, direction, radius, length); +} + +void ODERigidBody::SetCapsuleTotal(float total_mass, float radius, float length) +{ + dMass ODEMass; + PrepareCapsuleTotal(ODEMass, total_mass, radius, length); + dBodySetMass(mODEBody, &ODEMass); +} + +void ODERigidBody::AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix) +{ + dMass ODEMass; + PrepareCapsuleTotal(ODEMass, total_mass, radius, length); + AddMass(ODEMass, matrix); +} + +Vector3f ODERigidBody::GetVelocity() const +{ + const dReal* vel = dBodyGetLinearVel(mODEBody); + return Vector3f(vel[0], vel[1], vel[2]); +} + +void ODERigidBody::SetVelocity(const Vector3f& vel) +{ + dBodySetLinearVel(mODEBody, vel[0], vel[1], vel[2]); +} + +void ODERigidBody::SetRotation(const Matrix& rot) +{ + dMatrix3 m; + ConvertRotationMatrix(rot,m); + dBodySetRotation(mODEBody,m); +} + +salt::Matrix ODERigidBody::GetRotation() const +{ + const dReal* m = dBodyGetRotation(mODEBody); + salt::Matrix rot; + ConvertRotationMatrix(m,rot); + return rot; +} + +Vector3f ODERigidBody::GetAngularVelocity() const +{ + const dReal* vel = dBodyGetAngularVel(mODEBody); + return Vector3f(vel[0], vel[1], vel[2]); +} + +void ODERigidBody::SetAngularVelocity(const Vector3f& vel) +{ + dBodySetAngularVel(mODEBody, vel[0], vel[1], vel[2]); +} + +void ODERigidBody::SynchronizeParent() const +{ + const dReal* pos = dBodyGetPosition(mODEBody); + const dReal* rot = dBodyGetRotation(mODEBody); + + shared_ptr<BaseNode> baseNode = shared_static_cast<BaseNode> + (GetParent().lock()); + + + Matrix mat; + mat.m[0] = rot[0]; + mat.m[1] = rot[4]; + mat.m[2] = rot[8]; + mat.m[3] = 0; + mat.m[4] = rot[1]; + mat.m[5] = rot[5]; + mat.m[6] = rot[9]; + mat.m[7] = 0; + mat.m[8] = rot[2]; + mat.m[9] = rot[6]; + mat.m[10] = rot[10]; + mat.m[11] = 0; + mat.m[12] = pos[0]; + mat.m[13] = pos[1]; + mat.m[14] = pos[2]; + mat.m[15] = 1; + + baseNode->SetWorldTransform(mat); +} + +void ODERigidBody::PrePhysicsUpdateInternal(float /*deltaTime*/) +{ + // Check whether mass/body has been translated + if (mMassTransformed) + { + weak_ptr<Node> parent = GetParent(); + + // Update colliders (only those encapsulated in transform colliders) + TLeafList transformColliders; + parent.lock()->ListChildrenSupportingClass<TransformCollider>(transformColliders); + + for (TLeafList::iterator iter = transformColliders.begin(); iter != transformColliders.end(); ++iter) + { + // Only move non-transform colliders + shared_ptr<Collider> collider = shared_static_cast<TransformCollider>(*iter)->FindChildSupportingClass<Collider>(); + if (collider.get()) + { + Vector3f pos = collider->GetPosition(); + pos = pos + mMassTrans; + collider->SetLocalPosition(pos); + } + } + + // Update visuals (or other transforms in the tree) + TLeafList transforms; + parent.lock()->ListShallowChildrenSupportingClass<Transform>(transforms); + for (TLeafList::iterator iter = transforms.begin(); iter != transforms.end(); ++iter) + { + shared_ptr<Transform> transform = shared_dynamic_cast<Transform>(*iter); + Matrix worldTransform = transform->GetWorldTransform(); + worldTransform.Pos() = worldTransform.Pos() + mMassTrans; + transform->SetWorldTransform(worldTransform); + } + + mMassTrans = Vector3f(0,0,0); + mMassTransformed = false; + } +} + + +void ODERigidBody::PostPhysicsUpdateInternal() +{ + SynchronizeParent(); +} + +shared_ptr<RigidBody> ODERigidBody::GetBody(dBodyID id) +{ + if (id == 0) + { + return shared_ptr<RigidBody>(); + } + + RigidBody* bodyPtr = + static_cast<RigidBody*>(dBodyGetData(id)); + + if (bodyPtr == 0) + { + // we cannot use the logserver here + cerr << "ERROR: (ODERigidBody) no body found for dBodyID " + << id << "\n"; + return shared_ptr<RigidBody>(); + } + + shared_ptr<RigidBody> body = shared_static_cast<RigidBody> + (bodyPtr->GetSelf().lock()); + + if (body.get() == 0) + { + // we cannot use the logserver here + cerr << "ERROR: (ODERigidBody) got no shared_ptr for dBodyID " + << id << "\n"; + } + + return body; +} + +void ODERigidBody::AddForce(const Vector3f& force) +{ + dBodyAddForce(mODEBody, force.x(), force.y(), force.z()); +} + +void ODERigidBody::AddTorque(const Vector3f& torque) +{ + dBodyAddTorque(mODEBody, torque.x(), torque.y(), torque.z()); +} + +void ODERigidBody::SetPosition(const Vector3f& pos) +{ + dBodySetPosition(mODEBody, pos.x(), pos.y(), pos.z()); + // the parent node will be updated in the next physics cycle +} + +Vector3f ODERigidBody::GetPosition() const +{ + const dReal* pos = dBodyGetPosition(mODEBody); + return Vector3f(pos[0], pos[1], pos[2]); +} + +void ODERigidBody::TranslateMass(const Vector3f& v) +{ + dMass m; + dBodyGetMass(mODEBody, &m); + dMassTranslate(&m,v[0],v[1],v[2]); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,103 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODERIGIDBODY_H +#define OXYGEN_ODERIGIDBODY_H + +#include <oxygen/physicsserver/int/rigidbodyint.h> + +namespace oxygen +{ + +class OXYGEN_API ODERigidBody : public RigidBodyInt +{ +public: + ODERigidBody(); + virtual ~ODERigidBody(); + + dBodyID GetODEBody() const; + void Enable(); + void Disable(); + bool IsEnabled() const; + void UseGravity(bool f); + bool UsesGravity() const; + void SetMass(float mass); + void SetMassParameters(const dMass& mass); + float GetMass() const; + void GetMassParameters(dMass& mass) const; + void SetSphere(float density, float radius); + void AddSphere(float density, float radius, const salt::Matrix& matrix); + void SetSphereTotal(float total_mass, float radius); + void AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix); + void SetBox(float density, const salt::Vector3f& size); + void AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix); + void SetBoxTotal(float total_mass, const salt::Vector3f& size); + void AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix); + void SetCylinder(float density, float radius, float length); + void AddCylinder(float density, float radius, float length, const salt::Matrix& matrix); + void SetCylinderTotal(float total_mass, float radius, float length); + void AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + void SetCapsule(float density, float radius, float length); + void AddCapsule(float density, float radius, float length, const salt::Matrix& matrix); + void SetCapsuleTotal(float total_mass, float radius, float length); + void AddCapsuleTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + void TranslateMass(const salt::Vector3f& v); + salt::Vector3f GetVelocity() const; + void SetVelocity(const salt::Vector3f& vel); + void SetRotation(const salt::Matrix& rot); + salt::Matrix GetRotation() const; + salt::Vector3f GetAngularVelocity() const; + void SetAngularVelocity(const salt::Vector3f& vel); + void AddForce(const salt::Vector3f& force); + void AddTorque(const salt::Vector3f& torque); + void SetPosition(const salt::Vector3f& pos); + salt::Vector3f GetPosition() const; + void DestroyPhysicsObject(); + void SynchronizeParent() const; + void AddMass(const dMass& mass, const salt::Matrix& matrix); + //salt::Vector3f GetMassCenter() const; + boost::shared_ptr<RigidBody> GetBody(dBodyID id); //static in rigidbody.h + +protected: + void OnLink(); + bool CreateBody(); + void PrepareBoxTotal(dMass& mass, float total_mass, const salt::Vector3f& size) const; + void PrepareBox(dMass& mass, float density, const salt::Vector3f& size) const; + void PrepareSphere(dMass& mass, float density, float radius) const; + void PrepareSphereTotal(dMass& mass, float total_mass, float radius) const; + void PrepareCylinder(dMass& mass, float density, float radius, float length) const; + void PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const; + void PrepareCapsule(dMass& mass, float density, float radius, float length) const; + void PrepareCapsuleTotal(dMass& mass, float total_mass, float radius, float length) const; + +private: + void PrePhysicsUpdateInternal(float deltaTime); + void PostPhysicsUpdateInternal(); + +protected: + dBodyID mODEBody; + salt::Vector3f mMassTrans; + bool mMassTransformed; +}; + +} //namespace oxygen + +#endif //OXYGEN_ODERIGIDBODY_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,32 @@ +/* -*- 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/odesoftbody.h> + +using namespace oxygen; + +ODESoftBody::ODESoftBody() : SoftBodyInt(){ + +} + +ODESoftBody::~ODESoftBody(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesoftbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODESOFTBODY_H +#define OXYGEN_ODESOFTBODY_H + +#include <oxygen/physicsserver/int/softbodyint.h> + +namespace oxygen +{ + +class OXYGEN_API ODESoftBody : public SoftBodyInt +{ +public: + ODESoftBody(); + virtual ~ODESoftBody(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODESOFTBODY_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,32 @@ +/* -*- 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/odestaticbody.h> + +using namespace oxygen; + +ODEStaticBody::ODEStaticBody() : StaticBodyInt(){ + +} + +ODEStaticBody::~ODEStaticBody(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odestaticbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODESTATICBODY_H +#define OXYGEN_ODESTATICBODY_H + +#include <oxygen/physicsserver/int/staticbodyint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEStaticBody : public StaticBodyInt +{ +public: + ODEStaticBody(); + virtual ~ODEStaticBody(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODESTATICBODY_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -17,13 +17,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include <oxygen/physicsserver/rigidbody.h> #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/ode/oderigidbody.h> #include <oxygen/sceneserver/scene.h> -#include "zeitgeist/logserver/logserver.h" #include <oxygen/sceneserver/transform.h> +#include <zeitgeist/logserver/logserver.h> using namespace boost; using namespace oxygen; @@ -32,6 +32,7 @@ RigidBody::RigidBody() : Body(), mODEBody(0), mMassTrans(0,0,0), mMassTransformed(false) { + mRigidBodyImp = boost::shared_ptr<ODERigidBody>(new ODERigidBody()); } RigidBody::~RigidBody() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -28,6 +28,7 @@ namespace oxygen { class World; +class RigidBodyInt; /** Body encapsulates an ODE rigid body object. A rigid body has various properties from the point of view of the simulation. Some @@ -318,6 +319,8 @@ // Members // protected: + boost::shared_ptr<RigidBodyInt> mRigidBodyImp; + /** the managed ode body */ dBodyID mODEBody; Added: branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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/softbody.h> +#include <oxygen/physicsserver/ode/odesoftbody.h> + +using namespace oxygen; + +SoftBody::SoftBody() : Body(){ + mSoftBodyImp = boost::shared_ptr<ODESoftBody>(new ODESoftBody()); +} + +SoftBody::~SoftBody(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -27,6 +27,7 @@ namespace oxygen { +class SoftBodyInt; /** SoftBody is not yet implemented. */ @@ -37,8 +38,10 @@ // Functions // public: - SoftBody() : Body(){}; - virtual ~SoftBody(){}; + SoftBody(); + virtual ~SoftBody(); + + boost::shared_ptr<SoftBodyInt> mSoftBodyImp; }; DECLARE_CLASS(SoftBody); Added: branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp 2009-11-30 08:31:04 UTC (rev 110) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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/staticbody.h> +#include <oxygen/physicsserver/ode/odestaticbody.h> + +using namespace oxygen; + +StaticBody::StaticBody() : Body(){ + mStaticBodyImp = boost::shared_ptr<ODEStaticBody>(new ODEStaticBody()); +} + +StaticBody::~StaticBody(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h 2009-11-26 10:30:24 UTC (rev 109) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h 2009-11-30 08:31:04 UTC (rev 110) @@ -27,6 +27,7 @@ namespace oxygen { +class StaticBodyInt; /** StaticBody is not yet implemented. */ @@ -37,8 +38,10 @@ // Functions // public: - StaticBody() : Body(){}; - virtual ~StaticBody(){}; + StaticBody(); + virtual ~StaticBody(); + + boost::shared_ptr<StaticBodyInt> mStaticBodyImp; }; DECLARE_CLASS(StaticBody); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-12-09 08:42:53
|
Revision: 117 http://simspark.svn.sourceforge.net/simspark/?rev=117&view=rev Author: a-held Date: 2009-12-09 08:42:42 +0000 (Wed, 09 Dec 2009) Log Message: ----------- provided bridge pattern for ConvexCollider and CylinderCollider implemented bridge pattern for BoxCollider and SphereCollider Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.h Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-09 08:42:42 UTC (rev 117) @@ -55,9 +55,12 @@ #interfaces physicsserver/int/bodyint.h + physicsserver/int/boxcolliderint.h physicsserver/int/colliderint.h physicsserver/int/compoundcolliderint.h physicsserver/int/concavecolliderint.h + physicsserver/int/convexcolliderint.h + physicsserver/int/cylindercolliderint.h physicsserver/int/dynamicbodyint.h physicsserver/int/emptycolliderint.h physicsserver/int/physicsobjectint.h @@ -65,21 +68,26 @@ physicsserver/int/rigidbodyint.h physicsserver/int/softbodyint.h physicsserver/int/spaceint.h + physicsserver/int/spherecolliderint.h physicsserver/int/staticbodyint.h physicsserver/int/worldint.h #ode-specific files physicsserver/ode/odebody.h + physicsserver/ode/odeboxcollider.h physicsserver/ode/odedynamicbody.h physicsserver/ode/odecollider.h physicsserver/ode/odecompoundcollider.h physicsserver/ode/odeconcavecollider.h + physicsserver/ode/odeconvexcollider.h + physicsserver/ode/odecylindercollider.h physicsserver/ode/odeemptycollider.h physicsserver/ode/odephysicsobject.h physicsserver/ode/odephysicsserver.h physicsserver/ode/oderigidbody.h physicsserver/ode/odesoftbody.h physicsserver/ode/odespace.h + physicsserver/ode/odespherecollider.h physicsserver/ode/odestaticbody.h physicsserver/ode/odeworld.h physicsserver/ode/odewrapper.h @@ -163,7 +171,6 @@ physicsserver/boxcollider_c.cpp physicsserver/capsulecollider.cpp physicsserver/capsulecollider_c.cpp - physicsserver/cylindercollider_c.cpp physicsserver/collider.cpp physicsserver/collider_c.cpp physicsserver/compoundcollider.cpp @@ -171,11 +178,14 @@ physicsserver/concavecollider.cpp physicsserver/concavecollider_c.cpp physicsserver/conecollider_c.cpp + physicsserver/convexcollider.cpp physicsserver/convexcollider_c.cpp physicsserver/collisionhandler.cpp physicsserver/collisionhandler_c.cpp physicsserver/contactjointhandler.cpp physicsserver/contactjointhandler_c.cpp + physicsserver/cylindercollider.cpp + physicsserver/cylindercollider_c.cpp physicsserver/emptycollider.cpp physicsserver/emptycollider_c.cpp physicsserver/physicsserver.cpp @@ -217,9 +227,12 @@ #ODE-specific files physicsserver/ode/odebody.cpp + physicsserver/ode/odeboxcollider.cpp + physicsserver/ode/odecollider.cpp physicsserver/ode/odecompoundcollider.cpp physicsserver/ode/odeconcavecollider.cpp - physicsserver/ode/odecollider.cpp + physicsserver/ode/odeconvexcollider.cpp + physicsserver/ode/odecylindercollider.cpp physicsserver/ode/odedynamicbody.cpp physicsserver/ode/odeemptycollider.cpp physicsserver/ode/odephysicsobject.cpp @@ -227,6 +240,7 @@ physicsserver/ode/oderigidbody.cpp physicsserver/ode/odesoftbody.cpp physicsserver/ode/odespace.cpp + physicsserver/ode/odespherecollider.cpp physicsserver/ode/odestaticbody.cpp physicsserver/ode/odeworld.cpp Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -21,27 +21,22 @@ */ #include <oxygen/physicsserver/boxcollider.h> +#include <oxygen/physicsserver/ode/odeboxcollider.h> using namespace oxygen; using namespace salt; BoxCollider::BoxCollider() : ConvexCollider() { + mBoxColliderImp = boost::shared_ptr<ODEBoxCollider>(new ODEBoxCollider()); } -void -BoxCollider::SetBoxLengths(const Vector3f& extents) +void BoxCollider::SetBoxLengths(const Vector3f& extents) { - dGeomBoxSetLengths( - mODEGeom, - extents[0], - extents[1], - extents[2] - ); + mBoxColliderImp->SetBoxLengths(extents); } -bool -BoxCollider::ConstructInternal() +bool BoxCollider::ConstructInternal() { if (! Collider::ConstructInternal()) { @@ -49,23 +44,18 @@ } // create a unit box - mODEGeom = dCreateBox (0, 1.0f, 1.0f, 1.0f); + mBoxColliderImp->CreateBox(); + mODEGeom = (dGeomID) mBoxColliderImp->GetGeomID(); - return (mODEGeom != 0); + return (mBoxColliderImp->GetGeomID() != 0); } -void -BoxCollider::GetBoxLengths(Vector3f& extents) +void BoxCollider::GetBoxLengths(Vector3f& extents) { - dVector3 lengths; - dGeomBoxGetLengths(mODEGeom,lengths); - extents[0] = lengths[0]; - extents[1] = lengths[1]; - extents[2] = lengths[2]; + mBoxColliderImp->GetBoxLengths(extents); } -float -BoxCollider::GetBoxLength(int axis) +float BoxCollider::GetBoxLength(int axis) { if ( (axis<0) || @@ -80,12 +70,8 @@ return extents[axis]; } -float -BoxCollider::GetPointDepth(const Vector3f& pos) +float BoxCollider::GetPointDepth(const Vector3f& pos) { Vector3f worldPos(GetWorldTransform() * pos); - return dGeomBoxPointDepth - (mODEGeom,worldPos[0],worldPos[1],worldPos[2]); + return mBoxColliderImp->GetPointDepth(worldPos); } - - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -27,6 +27,7 @@ namespace oxygen { +class BoxColliderInt; /** BoxCollider encapsulates an ODE box geometry object. */ @@ -60,6 +61,9 @@ protected: /** constructs a default box with side lengths of 1 */ virtual bool ConstructInternal(); + +private: + boost::shared_ptr<BoxColliderInt> mBoxColliderImp; }; DECLARE_CLASS(BoxCollider); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -46,7 +46,6 @@ { PhysicsObject::OnLink(); - weak_ptr<Node> parent = GetParent(); if ( (mODEGeom == 0) || @@ -150,9 +149,12 @@ } void Collider::OnCollision (boost::shared_ptr<Collider> collidee, - dContact& contact, ECollisionType type) + void* contact, ECollisionType type) { + dContact* helpContact = (dContact*) contact; + dContact& ODEContact = (dContact&) *helpContact; + TLeafList handlers; ListChildrenSupportingClass<CollisionHandler>(handlers); @@ -173,7 +175,7 @@ continue; } - handler->HandleCollision(collidee, contact); + handler->HandleCollision(collidee, ODEContact); } } @@ -298,7 +300,7 @@ } } -const Collider::TColliderNameSet & Collider::GetNotCollideWithSet() const +const Collider::TColliderNameSet& Collider::GetNotCollideWithSet() const { return mNotCollideWithSet; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -32,7 +32,7 @@ { class ColliderInt; -/** \class Collider encapsulates an ODE geometry object- geom for +/** \class Collider encapsulates a geometry object- geom for short. Geoms are the fundamental objects in the collision system. They represent a single rigid shape as for example a sphere or a box. A special kind of geom called 'space' can @@ -49,14 +49,17 @@ // public: /** enumerates the two different collision instances reported to - the OnCollision member for each collision reported from ODE. + the OnCollision member for each collision reported from the + physics engine. */ enum ECollisionType { - /** the collision pair as reported from ODE */ + /** the collision pair as reported from the physics engine */ CT_DIRECT, - /** the symmetric pair to the pair reported from ODE */ + /** the symmetric pair to the pair reported from the + physics engine + */ CT_SYMMETRIC }; @@ -80,11 +83,11 @@ \param holds the contact points between the two affected geoms as returned from ODE dCollide function - \param symmetric indicates tha this collision indicates a + \param symmetric indicates that this collision indicates a symmetric case */ virtual void OnCollision (boost::shared_ptr<Collider> collidee, - dContact& contact, ECollisionType type); + void* contact, ECollisionType type); /** registers a new collision handler to this collider. If no collision handler is registered until the first call to @@ -94,10 +97,10 @@ */ bool AddCollisionHandler(const std::string& handlerName); - /** returns the Collider corresponding to the given ODE geom */ + /** returns the Collider corresponding to the given geom */ static boost::shared_ptr<Collider> GetCollider(long geomID); - /** returns the ID of managed ODE geom */ + /** returns the ID of managed geom */ long GetGeomID(); /** sets the relative position of the managed geom directly. If @@ -120,23 +123,23 @@ */ virtual void SetRotation(const salt::Matrix& rot); - /** returns true if the ODE geom managed by this + /** returns true if the geom managed by this Collider intersects with the geom managed by the given collider */ bool Intersects(boost::shared_ptr<Collider> collider); - /** returns the ODE handle ID of the containing parent space */ + /** returns the handle ID of the containing parent space */ virtual long GetParentSpaceID(); /** Add/Reomve a collider name that not collide with */ - void AddNotCollideWithColliderName(const std::string & colliderName, bool isAdd); + void AddNotCollideWithColliderName(const std::string& colliderName, bool isAdd); /** Get the not collide with collider set */ - const TColliderNameSet & GetNotCollideWithSet() const; + const TColliderNameSet& GetNotCollideWithSet() const; protected: /** registers the managed geom to the Space of the Scene and to - the associated ODE body + the associated body */ virtual void OnLink(); @@ -165,7 +168,7 @@ protected: /** a set that store the colliders that I never collide with - Note: they are should in the same space, orelse this is ignored + Note: they should be in the same space, or else this is ignored */ TColliderNameSet mNotCollideWithSet; }; Added: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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/convexcollider.h> +#include <oxygen/physicsserver/ode/odeconvexcollider.h> + +using namespace oxygen; + +ConvexCollider::ConvexCollider() : Collider(){ + mConvexColliderImp = boost::shared_ptr<ODEConvexCollider>(new ODEConvexCollider()); +} + +ConvexCollider::~ConvexCollider(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -27,15 +27,21 @@ namespace oxygen { +class ConvexColliderInt; + /** ConvexCollider is the common base class of all convex geometry objects, such as spheres and boxes. */ class OXYGEN_API ConvexCollider : public Collider { + public: - ConvexCollider() : Collider(){}; - virtual ~ConvexCollider(){}; + ConvexCollider(); + virtual ~ConvexCollider(); + +private: + boost::shared_ptr<ConvexColliderInt> mConvexColliderImp; }; DECLARE_ABSTRACTCLASS(ConvexCollider); Added: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,33 @@ +/* -*- 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: body.h 106 2009-11-19 10:10:50Z a-held $ + + 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/cylindercollider.h> +#include <oxygen/physicsserver/ode/odecylindercollider.h> + +using namespace oxygen; + +CylinderCollider::CylinderCollider() : ConvexCollider(){ + mCylinderColliderImp = boost::shared_ptr<ODECylinderCollider>(new ODECylinderCollider()); +} + +CylinderCollider::~CylinderCollider(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -27,6 +27,8 @@ namespace oxygen { +class CylinderColliderInt; + /** CylinderCollider is not yet implemented. */ @@ -37,8 +39,11 @@ // Functions // public: - CylinderCollider() : ConvexCollider(){}; - virtual ~CylinderCollider(){}; + CylinderCollider(); + virtual ~CylinderCollider(); + +private: + boost::shared_ptr<CylinderColliderInt> mCylinderColliderImp; }; DECLARE_CLASS(CylinderCollider); Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,46 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_BOXCOLLIDERINT_H +#define OXYGEN_BOXCOLLIDERINT_H + +#include <salt/salt.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API BoxColliderInt +{ + +public: + virtual void SetBoxLengths(const salt::Vector3f& extents) = 0; + virtual void GetBoxLengths(salt::Vector3f& extents) = 0; + virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void CreateBox() = 0; + + virtual long GetGeomID() = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_BOXCOLLIDERINT_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2009-12-09 08:42:42 UTC (rev 117) @@ -63,7 +63,7 @@ virtual void DestroyPhysicsObject() = 0; protected: - dGeomID mODEGeom; + long mGeomID; TColliderNameSet mNotCollideWithSet; }; Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,38 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_CONVEXCOLLIDERINT_H +#define OXYGEN_CONVEXCOLLIDERINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API ConvexColliderInt +{ + +}; + +} //namespace oxygen + +#endif //OXYGEN_CONVEXCOLLIDERINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,38 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_CYLINDERCOLLIDERINT_H +#define OXYGEN_CYLINDERCOLLIDERINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API CylinderColliderInt +{ + +}; + +} //namespace oxygen + +#endif //OXYGEN_CYLINDERCOLLIDERINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,46 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_SPHERECOLLIDERINT_H +#define OXYGEN_SPHERECOLLIDERINT_H + +#include <salt/salt.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API SphereColliderInt +{ + +public: + virtual void SetRadius(float r) = 0; + virtual float GetRadius() const = 0; + virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + virtual void CreateSphere() = 0; + + virtual long GetGeomID() = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_SPHERECOLLIDERINT_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odebody.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -4,7 +4,7 @@ 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 $ + $Id: odebody.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 Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,67 @@ +/* -*- 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: boxcollider.cpp 108 2009-11-25 10:20:10Z a-held $ + + 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/collider.h> +#include <oxygen/physicsserver/ode/odeboxcollider.h> + +using namespace oxygen; +using namespace salt; + +ODEBoxCollider::ODEBoxCollider() : ODEConvexCollider() +{ + +} + +void ODEBoxCollider::SetBoxLengths(const Vector3f& extents) +{ + dGeomBoxSetLengths( + mODEGeom, + extents[0], + extents[1], + extents[2] + ); +} + +void ODEBoxCollider::CreateBox() +{ + mODEGeom = dCreateBox (0, 1.0f, 1.0f, 1.0f); + mGeomID = (long) mODEGeom; +} + +void ODEBoxCollider::GetBoxLengths(Vector3f& extents) +{ + dVector3 lengths; + dGeomBoxGetLengths(mODEGeom,lengths); + extents[0] = lengths[0]; + extents[1] = lengths[1]; + extents[2] = lengths[2]; +} + +float ODEBoxCollider::GetPointDepth(const Vector3f& pos) +{ + return dGeomBoxPointDepth + (mODEGeom,pos[0],pos[1],pos[2]); +} + +long ODEBoxCollider::GetGeomID(){ + return mGeomID; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeboxcollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,47 @@ +/* -*- 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_ODEBOXCOLLIDER_H +#define OXYGEN_ODEBOXCOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/int/boxcolliderint.h> +#include <oxygen/physicsserver/ode/odeconvexcollider.h> + +namespace oxygen +{ + +class OXYGEN_API ODEBoxCollider : public BoxColliderInt, public ODEConvexCollider +{ +public: + ODEBoxCollider(); + void SetBoxLengths(const salt::Vector3f& extents); + void GetBoxLengths(salt::Vector3f& extents); + float GetPointDepth(const salt::Vector3f& pos); + void CreateBox(); + + long GetGeomID(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEBOXCOLLIDER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -37,6 +37,7 @@ ODECollider::ODECollider() : ODEPhysicsObject(), mODEGeom(0) { + mGeomID = 0; } ODECollider::~ODECollider() Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,28 @@ +/* -*- 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/odeconvexcollider.h> + +using namespace oxygen; + +ODEConvexCollider::ODEConvexCollider() : ODECollider(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconvexcollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODECONVEXCOLLIDER_H +#define OXYGEN_ODECONVEXCOLLIDER_H + +#include <oxygen/physicsserver/ode/odecollider.h> +#include <oxygen/physicsserver/int/convexcolliderint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEConvexCollider : public ConvexColliderInt, public ODECollider +{ +public: + ODEConvexCollider(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODECONVEXCOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,28 @@ +/* -*- 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/odecylindercollider.h> + +using namespace oxygen; + +ODECylinderCollider::ODECylinderCollider() : ODEConvexCollider(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecylindercollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODECYLINDERCOLLIDER_H +#define OXYGEN_ODECYLINDERCOLLIDER_H + +#include <oxygen/physicsserver/ode/odeconvexcollider.h> +#include <oxygen/physicsserver/int/cylindercolliderint.h> + +namespace oxygen +{ + +class OXYGEN_API ODECylinderCollider : public CylinderColliderInt, public ODEConvexCollider +{ +public: + ODECylinderCollider(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODECYLINDERCOLLIDER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -32,7 +32,7 @@ using namespace salt; using namespace std; -ODERigidBody::ODERigidBody() : ODEBody(){ +ODERigidBody::ODERigidBody() : ODEBody(), mODEBody(0){ mBodyID = 0; mMassTrans = Vector3f(0,0,0); mMassTransformed = false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespace.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -158,8 +158,8 @@ for (int i=0;i<n;++i) { // notify the collider nodes - collider->OnCollision(collidee,contacts[i],Collider::CT_DIRECT); - collidee->OnCollision(collider,contacts[i],Collider::CT_SYMMETRIC); + //collider->OnCollision(collidee,contacts[i],Collider::CT_DIRECT); + //collidee->OnCollision(collider,contacts[i],Collider::CT_SYMMETRIC); } } Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,57 @@ +/* -*- mode: c++ -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2003 Koblenz University + $Id: spherecollider.cpp 108 2009-11-25 10:20:10Z a-held $ + + 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/odespherecollider.h> + +using namespace oxygen; +using namespace salt; + +ODESphereCollider::ODESphereCollider() : ODEConvexCollider() +{ + mODEGeom = 0; + mGeomID = 0; +} + +void ODESphereCollider::SetRadius(float r) +{ + dGeomSphereSetRadius(mODEGeom, r); +} + +float ODESphereCollider::GetRadius() const +{ + return dGeomSphereGetRadius(mODEGeom); +} + +void ODESphereCollider::CreateSphere() +{ + mODEGeom = dCreateSphere(0, 1.0f); + mGeomID = (long) mODEGeom; +} + +float ODESphereCollider::GetPointDepth(const Vector3f& pos) +{ + return dGeomSpherePointDepth + (mODEGeom,pos[0],pos[1],pos[2]); +} + +long ODESphereCollider::GetGeomID(){ + return mGeomID; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odespherecollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -0,0 +1,46 @@ +/* -*- 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 $ + + 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_ODESPHERECOLLIDER_H +#define OXYGEN_ODESPHERECOLLIDER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/int/spherecolliderint.h> +#include <oxygen/physicsserver/ode/odeconvexcollider.h> + +namespace oxygen +{ + +class OXYGEN_API ODESphereCollider : public SphereColliderInt, public ODEConvexCollider +{ +public: + ODESphereCollider(); + void SetRadius(float r); + float GetRadius() const; + float GetPointDepth(const salt::Vector3f& pos); + void CreateSphere(); + + long GetGeomID(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODESPHERECOLLIDER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -138,8 +138,8 @@ if (s1 == s2) { - const oxygen::Collider::TColliderNameSet & collider_set = collider->GetNotCollideWithSet(); - const oxygen::Collider::TColliderNameSet & collidee_set = collidee->GetNotCollideWithSet(); + const oxygen::Collider::TColliderNameSet& collider_set = collider->GetNotCollideWithSet(); + const oxygen::Collider::TColliderNameSet& collidee_set = collidee->GetNotCollideWithSet(); if ( (collider_set.find(collidee->GetName()) != collider_set.end()) || (collidee_set.find(collider->GetName()) != collidee_set.end()) @@ -170,8 +170,8 @@ for (int i=0;i<n;++i) { // notify the collider nodes - collider->OnCollision(collidee,contacts[i],Collider::CT_DIRECT); - collidee->OnCollision(collider,contacts[i],Collider::CT_SYMMETRIC); + collider->OnCollision(collidee,(void*) &contacts[i],Collider::CT_DIRECT); + collidee->OnCollision(collider,(void*) &contacts[i],Collider::CT_SYMMETRIC); } } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2009-12-09 08:42:42 UTC (rev 117) @@ -20,44 +20,44 @@ */ #include <oxygen/physicsserver/spherecollider.h> +#include <oxygen/physicsserver/ode/odespherecollider.h> using namespace oxygen; using namespace salt; SphereCollider::SphereCollider() : ConvexCollider() { + mSphereColliderImp = boost::shared_ptr<ODESphereCollider>(new ODESphereCollider()); } -void -SphereCollider::SetRadius(float r) +void SphereCollider::SetRadius(float r) { - dGeomSphereSetRadius(mODEGeom, r); + mSphereColliderImp->SetRadius(r); } -float -SphereCollider::GetRadius() const +float SphereCollider::GetRadius() const { - return dGeomSphereGetRadius(mODEGeom); + return mSphereColliderImp->GetRadius(); } -bool -SphereCollider::ConstructInternal() +bool SphereCollider::ConstructInternal() { - if (! Collider::ConstructInternal()) + if (!Collider::ConstructInternal()) { return false; } + + // mODEGeom = dCreateSphere(0, 1.0f); // create a unit sphere - mODEGeom = dCreateSphere(0, 1.0f); + mSphereColliderImp->CreateSphere(); + mODEGeom = (dGeomID) mSphereColliderImp->GetGeomID(); - return (mODEGeom != 0); + return (mSphereColliderImp->GetGeomID() != 0); } -float -SphereCollider::GetPointDepth(const Vector3f& pos) +float SphereCollider::GetPointDepth(const Vector3f& pos) { Vector3f worldPos(GetWorldTransform() * pos); - return dGeomSpherePointDepth - (mODEGeom,worldPos[0],worldPos[1],worldPos[2]); + return mSphereColliderImp->GetPointDepth(worldPos); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h 2009-12-08 07:56:49 UTC (rev 116) +++ branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.h 2009-12-09 08:42:42 UTC (rev 117) @@ -27,8 +27,9 @@ namespace oxygen { +class SphereColliderInt; -/** SphereCollider encapsulates an ODE sphere geometry object. +/** SphereCollider encapsulates a sphere geometry object. */ class OXYGEN_API SphereCollider : public ConvexCollider { @@ -38,10 +39,10 @@ public: SphereCollider(); - /** sets the radius of the managed ODE sphere geom */ + /** sets the radius of the managed sphere geom */ void SetRadius(float r); - /** get the radius back from ODE */ + /** get the radius back from */ float GetRadius() const; /** returns the depth of the given relative position in the @@ -54,6 +55,9 @@ protected: /** constructs a default sphere with a radius of 1 */ virtual bool ConstructInternal(); + +private: + boost::shared_ptr<SphereColliderInt> mSphereColliderImp; }; DECLARE_CLASS(SphereCollider); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-12-11 08:54:08
|
Revision: 119 http://simspark.svn.sourceforge.net/simspark/?rev=119&view=rev Author: a-held Date: 2009-12-11 08:54:01 +0000 (Fri, 11 Dec 2009) Log Message: ----------- Implemented bridge pattern for RayCollider and PlaneCollider Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-10 08:34:56 UTC (rev 118) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-11 08:54:01 UTC (rev 119) @@ -68,6 +68,8 @@ physicsserver/int/emptycolliderint.h physicsserver/int/physicsobjectint.h physicsserver/int/physicsserverint.h + physicsserver/int/planecolliderint.h + physicsserver/int/raycolliderint.h physicsserver/int/rigidbodyint.h physicsserver/int/softbodyint.h physicsserver/int/spaceint.h @@ -89,6 +91,8 @@ physicsserver/ode/odeemptycollider.h physicsserver/ode/odephysicsobject.h physicsserver/ode/odephysicsserver.h + physicsserver/ode/odeplanecollider.h + physicsserver/ode/oderaycollider.h physicsserver/ode/oderigidbody.h physicsserver/ode/odesoftbody.h physicsserver/ode/odespace.h @@ -245,6 +249,8 @@ physicsserver/ode/odeemptycollider.cpp physicsserver/ode/odephysicsobject.cpp physicsserver/ode/odephysicsserver.cpp + physicsserver/ode/odeplanecollider.cpp + physicsserver/ode/oderaycollider.cpp physicsserver/ode/oderigidbody.cpp physicsserver/ode/odesoftbody.cpp physicsserver/ode/odespace.cpp Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,46 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_PLANECOLLIDERINT_H +#define OXYGEN_PLANECOLLIDERINT_H + +#include <salt/matrix.h> +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API PlaneColliderInt +{ +public: + virtual void SetPlaneParams(float a, float b, float c, float d) = 0; + virtual void SetParams(const salt::Vector3f& pos, salt::Vector3f normal) = 0; + virtual float GetPointDepth(const salt::Vector3f& pos) = 0; + + virtual long GetGeomID() = 0; + virtual void CreatePlane() = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_PLANECOLLIDERINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,42 @@ +/* -*- 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: raycolliderint.h 102 2009-11-18 07:24:29Z a-held $ + + 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_RAYCOLLIDERINT_H +#define OXYGEN_RAYCOLLIDERINT_H + +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API RayColliderInt +{ +public: + virtual void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length) = 0; + virtual void CreateRay() = 0; + virtual long GetGeomID() = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_RAYCOLLIDERINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.cpp 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,58 @@ +/* -*- 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: planecollider.cpp 108 2009-11-25 10:20:10Z a-held $ + + 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/odeplanecollider.h> + +using namespace oxygen; +using namespace salt; + +ODEPlaneCollider::ODEPlaneCollider() : ODECollider() +{ +} + +void ODEPlaneCollider::SetPlaneParams(float a, float b, float c, float d) +{ + dGeomPlaneSetParams(mODEGeom, a, b, c, d); +} + +void ODEPlaneCollider::CreatePlane() +{ + // a plane with normal pointing up, going through the origin + mODEGeom = dCreatePlane(0, 0, 1, 0, 0); + mGeomID = (long) mODEGeom; +} + +void ODEPlaneCollider::SetParams(const salt::Vector3f& pos, salt::Vector3f normal) +{ + normal.Normalize(); + float d = pos.Dot(normal); + dGeomPlaneSetParams(mODEGeom, normal.x(), normal.y(), normal.z(), d); +} + +float ODEPlaneCollider::GetPointDepth(const Vector3f& pos) +{ + return dGeomPlanePointDepth + (mODEGeom,pos[0],pos[1],pos[2]); +} + +long ODEPlaneCollider::GetGeomID(){ + return mGeomID; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeplanecollider.h 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,47 @@ +/* -*- 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: odeplanecollider.h 102 2009-11-18 07:24:29Z a-held $ + + 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_ODEPLANECOLLIDER_H +#define OXYGEN_ODEPLANECOLLIDER_H + +#include <oxygen/physicsserver/ode/odecollider.h> +#include <oxygen/physicsserver/int/planecolliderint.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API ODEPlaneCollider : public PlaneColliderInt, public ODECollider +{ +public: + ODEPlaneCollider(); + void SetPlaneParams(float a, float b, float c, float d); + void SetParams(const salt::Vector3f& pos, salt::Vector3f normal); + float GetPointDepth(const salt::Vector3f& pos); + + long GetGeomID(); + void CreatePlane(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEPLANECOLLIDER_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.cpp 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,46 @@ +/* -*- mode: c++ -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2003 Koblenz University + $Id: raycollider.cpp 108 2009-11-25 10:20:10Z a-held $ + + 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/oderaycollider.h> + +using namespace oxygen; + +ODERayCollider::ODERayCollider() : ODECollider() +{ + +} + +void ODERayCollider::SetParams(salt::Vector3f pos, + salt::Vector3f dir, float length) +{ + dGeomRaySet(mODEGeom, pos[0], pos[1], pos[2], dir[0], dir[1], dir[2]); + dGeomRaySetLength(mODEGeom, length); +} + +void ODERayCollider::CreateRay() +{ + mODEGeom = dCreateRay(0, 1.0f); + mGeomID = (long) mODEGeom; +} + +long ODERayCollider::GetGeomID(){ + return mGeomID; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderaycollider.h 2009-12-11 08:54:01 UTC (rev 119) @@ -0,0 +1,44 @@ +/* -*- 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: oderaycollider.h 102 2009-11-18 07:24:29Z a-held $ + + 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_ODERAYCOLLIDER_H +#define OXYGEN_ODERAYCOLLIDER_H + +#include <oxygen/physicsserver/ode/odecollider.h> +#include <oxygen/physicsserver/int/raycolliderint.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API ODERayCollider : public RayColliderInt, public ODECollider +{ +public: + ODERayCollider(); + void SetParams(salt::Vector3f pos, salt::Vector3f dir, float length); + void CreateRay(); + long GetGeomID(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODERAYCOLLIDER_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2009-12-10 08:34:56 UTC (rev 118) +++ branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2009-12-11 08:54:01 UTC (rev 119) @@ -20,12 +20,15 @@ */ #include <oxygen/physicsserver/planecollider.h> +#include <oxygen/physicsserver/ode/odeplanecollider.h> +#include <zeitgeist/logserver/logserver.h> using namespace oxygen; using namespace salt; PlaneCollider::PlaneCollider() : Collider() { + mPlaneColliderImp = boost::shared_ptr<ODEPlaneCollider>(new ODEPlaneCollider()); } void PlaneCollider::SetParams(float a, float b, float c, float d) @@ -40,7 +43,7 @@ d /= l; } - dGeomPlaneSetParams(mODEGeom, a, b, c, d); + mPlaneColliderImp->SetPlaneParams(a, b, c, d); } bool PlaneCollider::ConstructInternal() @@ -50,39 +53,35 @@ return false; } - // a plane with normal pointing up, going through the origin - mODEGeom = dCreatePlane(0, 0, 1, 0, 0); + //create default plane + mPlaneColliderImp->CreatePlane(); + mODEGeom = (dGeomID) mPlaneColliderImp->GetGeomID(); - return (mODEGeom != 0); + return (mPlaneColliderImp->GetGeomID() != 0); } -void -PlaneCollider::SetParams(const salt::Vector3f& pos, salt::Vector3f normal) +void PlaneCollider::SetParams(const salt::Vector3f& pos, salt::Vector3f normal) { normal.Normalize(); float d = pos.Dot(normal); - dGeomPlaneSetParams(mODEGeom, normal.x(), normal.y(), normal.z(), d); + mPlaneColliderImp->SetPlaneParams(normal.x(), normal.y(), normal.z(), d); + //dGeomPlaneSetParams(mODEGeom, normal.x(), normal.y(), normal.z(), d); } -void -PlaneCollider::SetPosition(const salt::Vector3f& /*pos*/) +void PlaneCollider::SetPosition(const salt::Vector3f& /*pos*/) { - // planes are non placeable geoms + GetLog()->Error() + << "(PlaneCollider) WARNING: tried to set the position of a non-placeable geom, ignored\n"; } -void -PlaneCollider::SetRotation(const Matrix& /*rot*/) +void PlaneCollider::SetRotation(const Matrix& /*rot*/) { - // planes are non placeable geoms + GetLog()->Error() + << "(PlaneCollider) WARNING: tried to set the rotation of a non-placeable geom, ignored\n"; } -float -PlaneCollider::GetPointDepth(const Vector3f& pos) +float PlaneCollider::GetPointDepth(const Vector3f& pos) { Vector3f worldPos(GetWorldTransform() * pos); - return dGeomPlanePointDepth - (mODEGeom,worldPos[0],worldPos[1],worldPos[2]); + return mPlaneColliderImp->GetPointDepth(worldPos); } - - - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.h 2009-12-10 08:34:56 UTC (rev 118) +++ branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.h 2009-12-11 08:54:01 UTC (rev 119) @@ -27,6 +27,7 @@ namespace oxygen { +class PlaneColliderInt; /** PlaneCollider encapsulates an ODE plane geometry object. Planes are non-placeable geoms, i.e. unlike placeable geoms, planes do @@ -74,6 +75,9 @@ /** constructs a default plane with normal pointing up, going through the origin */ virtual bool ConstructInternal(); + +private: + boost::shared_ptr<PlaneColliderInt> mPlaneColliderImp; }; DECLARE_CLASS(PlaneCollider); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2009-12-10 08:34:56 UTC (rev 118) +++ branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2009-12-11 08:54:01 UTC (rev 119) @@ -19,24 +19,23 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <oxygen/physicsserver/ode/oderaycollider.h> #include <oxygen/physicsserver/raycollider.h> using namespace oxygen; RayCollider::RayCollider() : Collider() { + mRayColliderImp = boost::shared_ptr<ODERayCollider>(new ODERayCollider()); } -void -RayCollider::SetParams(salt::Vector3f pos, +void RayCollider::SetParams(salt::Vector3f pos, salt::Vector3f dir, float length) { - dGeomRaySet(mODEGeom, pos[0], pos[1], pos[2], dir[0], dir[1], dir[2]); - dGeomRaySetLength(mODEGeom, length); + mRayColliderImp->SetParams(pos, dir, length); } -bool -RayCollider::ConstructInternal() +bool RayCollider::ConstructInternal() { if (! Collider::ConstructInternal()) { @@ -44,7 +43,8 @@ } // create a unit ray - mODEGeom = dCreateRay(0, 1.0f); + mRayColliderImp->CreateRay(); + mODEGeom = (dGeomID) mRayColliderImp->GetGeomID(); - return (mODEGeom != 0); + return (mRayColliderImp->GetGeomID() != 0); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.h 2009-12-10 08:34:56 UTC (rev 118) +++ branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.h 2009-12-11 08:54:01 UTC (rev 119) @@ -27,6 +27,7 @@ namespace oxygen { +class RayColliderInt; /** RayCollider encapsulates an ODE ray geometry "object". * @@ -54,6 +55,9 @@ protected: /** constructs a default ray with a length of 1 */ virtual bool ConstructInternal(); + +private: + boost::shared_ptr<RayColliderInt> mRayColliderImp; }; DECLARE_CLASS(RayCollider); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2009-12-16 10:43:58
|
Revision: 122 http://simspark.svn.sourceforge.net/simspark/?rev=122&view=rev Author: a-held Date: 2009-12-16 10:43:50 +0000 (Wed, 16 Dec 2009) Log Message: ----------- Prepared bridge pattern for all joint classes Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/collider.h branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint.h branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-16 10:43:50 UTC (rev 122) @@ -55,6 +55,7 @@ physicsserver/angularmotor.h #interfaces + physicsserver/int/balljointint.h physicsserver/int/bodyint.h physicsserver/int/boxcolliderint.h physicsserver/int/capsulecolliderint.h @@ -62,23 +63,32 @@ physicsserver/int/compoundcolliderint.h physicsserver/int/concavecolliderint.h physicsserver/int/conecolliderint.h + physicsserver/int/conetwistjointint.h physicsserver/int/convexcolliderint.h physicsserver/int/cylindercolliderint.h physicsserver/int/dynamicbodyint.h physicsserver/int/emptycolliderint.h + physicsserver/int/fixedjointint.h + physicsserver/int/generic6dofjointint.h + physicsserver/int/hingejointint.h + physicsserver/int/hinge2jointint.h + physicsserver/int/jointint.h physicsserver/int/physicsobjectint.h physicsserver/int/physicsserverint.h physicsserver/int/planecolliderint.h physicsserver/int/raycolliderint.h physicsserver/int/rigidbodyint.h + physicsserver/int/sliderjointint.h physicsserver/int/softbodyint.h physicsserver/int/spaceint.h physicsserver/int/spherecolliderint.h physicsserver/int/staticbodyint.h physicsserver/int/transformcolliderint.h + physicsserver/int/universaljointint.h physicsserver/int/worldint.h #ode-specific files + physicsserver/ode/odeballjoint.h physicsserver/ode/odebody.h physicsserver/ode/odeboxcollider.h physicsserver/ode/odedynamicbody.h @@ -87,19 +97,27 @@ physicsserver/ode/odecompoundcollider.h physicsserver/ode/odeconcavecollider.h physicsserver/ode/odeconecollider.h + physicsserver/ode/odeconetwistjoint.h physicsserver/ode/odeconvexcollider.h physicsserver/ode/odecylindercollider.h physicsserver/ode/odeemptycollider.h + physicsserver/ode/odefixedjoint.h + physicsserver/ode/odegeneric6dofjoint.h + physicsserver/ode/odehingejoint.h + physicsserver/ode/odehinge2joint.h + physicsserver/ode/odejoint.h physicsserver/ode/odephysicsobject.h physicsserver/ode/odephysicsserver.h physicsserver/ode/odeplanecollider.h physicsserver/ode/oderaycollider.h physicsserver/ode/oderigidbody.h + physicsserver/ode/odesliderjoint.h physicsserver/ode/odesoftbody.h physicsserver/ode/odespace.h physicsserver/ode/odespherecollider.h physicsserver/ode/odestaticbody.h physicsserver/ode/odetransformcollider.h + physicsserver/ode/odeuniversaljoint.h physicsserver/ode/odeworld.h physicsserver/ode/odewrapper.h @@ -220,9 +238,11 @@ physicsserver/velocitycontroller_c.cpp physicsserver/joint.cpp physicsserver/joint_c.cpp + physicsserver/generic6dofjoint.cpp physicsserver/generic6dofjoint_c.cpp physicsserver/balljoint.cpp physicsserver/balljoint_c.cpp + physicsserver/conetwistjoint.cpp physicsserver/conetwistjoint_c.cpp physicsserver/hingejoint.cpp physicsserver/hingejoint_c.cpp @@ -238,6 +258,7 @@ physicsserver/angularmotor_c.cpp #ODE-specific files + physicsserver/ode/odeballjoint.cpp physicsserver/ode/odebody.cpp physicsserver/ode/odeboxcollider.cpp physicsserver/ode/odecapsulecollider.cpp @@ -245,20 +266,28 @@ physicsserver/ode/odecompoundcollider.cpp physicsserver/ode/odeconcavecollider.cpp physicsserver/ode/odeconecollider.cpp + physicsserver/ode/odeconetwistjoint.cpp physicsserver/ode/odeconvexcollider.cpp physicsserver/ode/odecylindercollider.cpp physicsserver/ode/odedynamicbody.cpp physicsserver/ode/odeemptycollider.cpp + physicsserver/ode/odefixedjoint.cpp + physicsserver/ode/odegeneric6dofjoint.cpp + physicsserver/ode/odehingejoint.cpp + physicsserver/ode/odehinge2joint.cpp + physicsserver/ode/odejoint.cpp physicsserver/ode/odephysicsobject.cpp physicsserver/ode/odephysicsserver.cpp physicsserver/ode/odeplanecollider.cpp physicsserver/ode/oderaycollider.cpp physicsserver/ode/oderigidbody.cpp + physicsserver/ode/odesliderjoint.cpp physicsserver/ode/odesoftbody.cpp physicsserver/ode/odespace.cpp physicsserver/ode/odespherecollider.cpp physicsserver/ode/odestaticbody.cpp physicsserver/ode/odetransformcollider.cpp + physicsserver/ode/odeuniversaljoint.cpp physicsserver/ode/odeworld.cpp sceneserver/basenode.cpp Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <oxygen/physicsserver/ode/odeballjoint.h> #include <oxygen/physicsserver/balljoint.h> using namespace oxygen; @@ -25,6 +26,7 @@ BallJoint::BallJoint() : Generic6DOFJoint() { + mBallJointImp = boost::shared_ptr<ODEBallJoint>(new ODEBallJoint()); } BallJoint::~BallJoint() @@ -88,6 +90,3 @@ // no ode get param fkt. defined return 0; } - - - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -25,6 +25,7 @@ namespace oxygen { +class BallJointInt; class OXYGEN_API BallJoint : public Generic6DOFJoint { @@ -42,7 +43,7 @@ the two bodies. If the joint is perfectly satisfied, the joint anchor point will be the same for both bodies. */ - salt::Vector3f GetAnchor (EBodyIndex idx); + salt::Vector3f GetAnchor(EBodyIndex idx); protected: /** creates a new contact joint */ @@ -53,6 +54,9 @@ /** returns a joint parameter value */ virtual float GetParameter(int parameter) const; + +private: + boost::shared_ptr<BallJointInt> mBallJointImp; }; DECLARE_CLASS(BallJoint); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.h 2009-12-16 10:43:50 UTC (rev 122) @@ -22,7 +22,6 @@ #ifndef OXYGEN_COLLIDER_H #define OXYGEN_COLLIDER_H -//#include <oxygen/physicsserver/ode/odewrapper.h> #include <oxygen/physicsserver/physicsobject.h> #include <oxygen/oxygen_defines.h> #include <string> Added: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,42 @@ +/* -*- 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: joint.h 107 2009-11-25 06:09:10Z a-held $ + + 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/conetwistjoint.h> +#include <oxygen/physicsserver/ode/odeconetwistjoint.h> + +using namespace oxygen; + +ConeTwistJoint::ConeTwistJoint() : Generic6DOFJoint(){ + mConeTwistJointImp = boost::shared_ptr<ODEConeTwistJoint>(new ODEConeTwistJoint()); +} + +ConeTwistJoint::~ConeTwistJoint(){ + +} + +void ConeTwistJoint::SetParameter(int parameter, float value){ + +} + +float ConeTwistJoint::GetParameter(int parameter) const{ + return 0.0; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -27,6 +27,8 @@ namespace oxygen { +class ConeTwistJointInt; + /** ConeTwistJoint is not yet implemented. */ @@ -35,13 +37,16 @@ { public: - ConeTwistJoint() : Generic6DOFJoint(){}; - virtual ~ConeTwistJoint(){}; + ConeTwistJoint(); + virtual ~ConeTwistJoint(); //overwrite pure virtual methods inherited from Joint //to shut the compiler up - void SetParameter(int parameter, float value){}; - float GetParameter(int parameter) const {}; + void SetParameter(int parameter, float value); + float GetParameter(int parameter) const; + +private: + boost::shared_ptr<ConeTwistJointInt> mConeTwistJointImp; }; DECLARE_CLASS(ConeTwistJoint); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -18,14 +18,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/fixedjoint.h> +#include <oxygen/physicsserver/ode/odefixedjoint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; -using namespace boost; -using namespace salt; FixedJoint::FixedJoint() : Generic6DOFJoint() { + mFixedJointImp = boost::shared_ptr<ODEFixedJoint>(new ODEFixedJoint()); } FixedJoint::~FixedJoint() @@ -58,4 +58,3 @@ { dJointSetFixed(mODEJoint); } - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -25,12 +25,15 @@ namespace oxygen { +class FixedJointInt; + /** The fixed joint maintains a fixed relative position and orientation between two bodies, or between a body and the static environment. */ class OXYGEN_API FixedJoint : public Generic6DOFJoint { + public: FixedJoint(); virtual ~FixedJoint(); @@ -49,6 +52,9 @@ /** returns a joint parameter value */ virtual float GetParameter(int parameter) const; + +private: + boost::shared_ptr<FixedJointInt> mFixedJointImp; }; DECLARE_CLASS(FixedJoint); Added: branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,34 @@ +/* -*- 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: joint.h 107 2009-11-25 06:09:10Z a-held $ + + 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/generic6dofjoint.h> +#include <oxygen/physicsserver/ode/odegeneric6dofjoint.h> + +using namespace oxygen; + +Generic6DOFJoint::Generic6DOFJoint() : Joint(){ + mGeneric6DOFJointImp = boost::shared_ptr<ODEGeneric6DOFJoint>(new ODEGeneric6DOFJoint()); +} + +Generic6DOFJoint::~Generic6DOFJoint(){ + +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -27,6 +27,8 @@ namespace oxygen { +class Generic6DOFJointInt; + /** Generic6DOFJoint is a placeholder class for "six degrees of freedom" - joints. They are supported by some 3D modelling tools and simspark shall eventually be able to import models created @@ -36,8 +38,11 @@ class OXYGEN_API Generic6DOFJoint : public Joint { public: - Generic6DOFJoint() : Joint(){}; - virtual ~Generic6DOFJoint(){}; + Generic6DOFJoint(); + virtual ~Generic6DOFJoint(); + +private: + boost::shared_ptr<Generic6DOFJointInt> mGeneric6DOFJointImp; }; DECLARE_ABSTRACTCLASS(Generic6DOFJoint); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hinge2joint.h> +#include <oxygen/physicsserver/ode/odehinge2joint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -26,6 +27,7 @@ Hinge2Joint::Hinge2Joint() : Generic6DOFJoint() { + mHinge2JointImp = boost::shared_ptr<ODEHinge2Joint>(new ODEHinge2Joint()); } Hinge2Joint::~Hinge2Joint() @@ -128,8 +130,3 @@ { return dJointGetHinge2Param(mODEJoint, parameter); } - - - - - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -25,6 +25,7 @@ namespace oxygen { +class Hinge2JointInt; class OXYGEN_API Hinge2Joint : public Generic6DOFJoint { @@ -62,6 +63,9 @@ /** returns a joint parameter value */ virtual float GetParameter(int parameter) const; + +private: + boost::shared_ptr<Hinge2JointInt> mHinge2JointImp; }; DECLARE_CLASS(Hinge2Joint); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hingejoint.h> +#include <oxygen/physicsserver/ode/odehingejoint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -26,6 +27,7 @@ HingeJoint::HingeJoint() : Generic6DOFJoint() { + mHingeJointImp = boost::shared_ptr<ODEHingeJoint>(new ODEHingeJoint()); } HingeJoint::~HingeJoint() @@ -138,9 +140,3 @@ { return dJointGetHingeParam(mODEJoint, parameter); } - - - - - - Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -26,6 +26,7 @@ namespace oxygen { class RigidBody; +class HingeJointInt; class OXYGEN_API HingeJoint : public Generic6DOFJoint { @@ -77,6 +78,9 @@ protected: /** creates a new hingejoint joint */ virtual void OnLink(); + +private: + boost::shared_ptr<HingeJointInt> mHingeJointImp; }; DECLARE_CLASS(HingeJoint); Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,45 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_BALLJOINTINT_H +#define OXYGEN_BALLJOINTINT_H + +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ +class RigidBody; +class Joint; + +class OXYGEN_API BallJointInt +{ +public: + virtual void SetAnchor(const salt::Vector3f& anchor) = 0; + virtual salt::Vector3f GetAnchor1() = 0; + virtual salt::Vector3f GetAnchor2() = 0; + virtual void CreateBallJoint(long world) = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_BALLJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,38 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_CONETWISTJOINTINT_H +#define OXYGEN_CONETWISTJOINTINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API ConeTwistJointInt +{ + +}; + +} //namespace oxygen + +#endif //OXYGEN_CONETWISTJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,36 @@ +/* -*- 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: fixedjoint.h 108 2009-11-25 10:20:10Z a-held $ + + 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_FIXEDJOINTINT_H +#define OXYGEN_FIXEDJOINTINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen{ + +class OXYGEN_API FixedJointInt{ + +public: + virtual void CreateFixedJoint(long world) = 0; + virtual void SetFixed() = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_FIXEDJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,38 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_GENERIC6DOFJOINTINT_H +#define OXYGEN_GENERIC6DOFJOINTINT_H + +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API Generic6DOFJointInt +{ + +}; + +} //namespace oxygen + +#endif //OXYGEN_GENERIC6DOFJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,46 @@ +/* -*- 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: hingejoint.h 108 2009-11-25 10:20:10Z a-held $ + + 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_HINGE2JOINTINT_H +#define OXYGEN_HINGE2JOINTINT_H + +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen{ + +class OXYGEN_API Hinge2JointInt{ + +public: + virtual void CreateHinge2Joint(long world) = 0; + virtual void SetAnchor(const salt::Vector3f& anchor, + const salt::Vector3f& up, + const salt::Vector3f& right) = 0; + virtual salt::Vector3f GetAnchor1() = 0; + virtual salt::Vector3f GetAnchor2() = 0; + virtual float GetAngle() = 0; + virtual float GetAngleRate1() = 0; + virtual float GetAngleRate2() = 0; + virtual void SetParameter(int parameter, float value) = 0; + virtual float GetParameter(int parameter) const = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_HINGE2JOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,45 @@ +/* -*- 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: hingejoint.h 108 2009-11-25 10:20:10Z a-held $ + + 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_HINGEJOINTINT_H +#define OXYGEN_HINGEJOINTINT_H + +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen{ + +class OXYGEN_API HingeJointInt{ + +public: + virtual void CreateHingeJoint(long world) = 0; + virtual void SetAnchor(const salt::Vector3f& anchor) = 0; + virtual salt::Vector3f GetAnchor1() = 0; + virtual salt::Vector3f GetAnchor2() = 0; + virtual void SetAxis(const salt::Vector3f& axis) = 0; + virtual salt::Vector3f GetAxis() = 0; + virtual float GetAngle() const = 0; + virtual float GetAngleRate() const = 0; + virtual void SetParameter(int parameter, float value) = 0; + virtual float GetParameter(int parameter) const = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_HINGEJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,127 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_JOINTINT_H +#define OXYGEN_JOINTINT_H + +#include <oxygen/physicsserver/ode/odewrapper.h> +#include <boost/smart_ptr/shared_ptr.hpp> +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> +#include <string> + +namespace oxygen +{ +class RigidBody; +class Joint; + +class OXYGEN_API JointInt +{ +public: + enum EBodyIndex + { + BI_FIRST = 0, + BI_SECOND = 1 + }; + + enum EAxisIndex + { + AI_FIRST = 0, + AI_SECOND = 1, + AI_THIRD = 2 + }; + + static Joint* GetJoint(long jointID){ + + } + + static bool AreConnected(boost::shared_ptr<RigidBody> body1, + boost::shared_ptr<RigidBody> body2){ + + } + + static bool AreConnectedExcluding(boost::shared_ptr<RigidBody> body1, + boost::shared_ptr<RigidBody> body2, + int joint_type){ + + } + + virtual void DestroyJoint() = 0; + virtual void Attach(boost::shared_ptr<RigidBody> body1, + boost::shared_ptr<RigidBody> body2) = 0; + virtual void Attach(const std::string& path1, const std::string& path2) = 0; + virtual int GetType() const = 0; + virtual boost::shared_ptr<RigidBody> GetBody(EBodyIndex idx) = 0; + virtual void EnableFeedback(bool enable) = 0; + virtual bool FeedbackEnabled() const = 0; + virtual salt::Vector3f GetFeedbackForce(EBodyIndex idx) const = 0; + virtual salt::Vector3f GetFeedbackTorque(EBodyIndex idx) const = 0; + virtual void SetFudgeFactor(EAxisIndex idx, float fudge_factor) = 0; + virtual float GetFudgeFactor(EAxisIndex idx) const = 0; + virtual void SetBounce(EAxisIndex idx, float bounce) = 0; + virtual float GetBounce(EAxisIndex idx) const = 0; + virtual void SetLowStopDeg(EAxisIndex idx, float deg) = 0; + virtual float GetLowStopDeg(EAxisIndex idx) const = 0; + virtual void SetHighStopDeg(EAxisIndex idx, float deg) = 0; + virtual float GetHighStopDeg(EAxisIndex idx) const = 0; + virtual void SetLowStopPos(EAxisIndex idx, float deg) = 0; + virtual float GetLowStopPos(EAxisIndex idx) const = 0; + virtual void SetHighStopPos(EAxisIndex idx, float deg) = 0; + virtual float GetHighStopPos(EAxisIndex idx) const = 0; + virtual void SetCFM(EAxisIndex idx, float cfm) = 0; + virtual float GetCFM(EAxisIndex idx) const = 0; + virtual void SetStopCFM(EAxisIndex idx, float cfm) = 0; + virtual float GetStopCFM(EAxisIndex idx) const = 0; + virtual void SetStopERP(EAxisIndex idx, float erp) = 0; + virtual float GetStopERP(EAxisIndex idx) const = 0; + virtual void SetSuspensionERP(EAxisIndex idx, float erp) = 0; + virtual float GetSuspensionERP(EAxisIndex idx) const = 0; + virtual void SetSuspensionCFM(EAxisIndex idx, float cfm) = 0; + virtual float GetSuspensionCFM(EAxisIndex idx) const = 0; + virtual void SetLinearMotorVelocity(EAxisIndex idx, float vel) = 0; + virtual float GetLinearMotorVelocity(EAxisIndex idx) const = 0; + virtual void SetAngularMotorVelocity(EAxisIndex idx, float deg) = 0; + virtual float GetAngularMotorVelocity(EAxisIndex idx) const = 0; + virtual void SetMaxMotorForce(EAxisIndex idx, float f) = 0; + virtual float GetMaxMotorForce(EAxisIndex idx) const = 0; + virtual void SetParameter(int parameter, float value) = 0; + virtual float GetParameter(int parameter) const = 0; + virtual void SetJointMaxSpeed1(float rad) = 0; + virtual void SetJointMaxSpeed2(float rad) = 0; + virtual float GetJointMaxSpeed1() const = 0; + virtual float GetJointMaxSpeed2() const = 0; + virtual bool IsLimitJointMaxSpeed1() const = 0; + virtual bool IsLimitJointMaxSpeed2() const = 0; + virtual void OnLink() = 0; + +protected: + dJointID mODEJoint; + boost::shared_ptr<dJointFeedback> mFeedback; + float mJointMaxSpeed1; + bool mIsLimitJointMaxSpeed1; + float mJointMaxSpeed2; + bool mIsLimitJointMaxSpeed2; +}; + +} //namespace oxygen + +#endif //OXYGEN_JOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,46 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_SLIDERJOINTINT_H +#define OXYGEN_SLIDERJOINTINT_H + +#include <boost/smart_ptr/shared_ptr.hpp> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ +class RigidBody; + +class OXYGEN_API SliderJointInt +{ +public: + virtual void CreateSliderJoint(long world) = 0; + virtual float GetPosition() = 0; + virtual float GetPositionRate() = 0; + virtual void SetSliderAxis(salt::Vector3f& up) = 0; + virtual void SetParameter(int parameter, float value) = 0; + virtual float GetParameter(int parameter) const = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_SLIDERJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,54 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_UNIVERSALJOINTINT_H +#define OXYGEN_UNIVERSALJOINTINT_H + +#include <salt/vector.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API UniversalJointInt +{ + +public: + virtual void CreateUniversalJoint(long world) = 0; + virtual void SetAnchor(const salt::Vector3f& anchor) = 0; + virtual salt::Vector3f GetAnchor1() = 0; + virtual salt::Vector3f GetAnchor2() = 0; + virtual void SetAxis1(const salt::Vector3f& axis) = 0; + virtual void SetAxis2(const salt::Vector3f& axis) = 0; + virtual salt::Vector3f GetAxis1() const = 0; + virtual salt::Vector3f GetAxis2() const = 0; + virtual float GetAngle1() const = 0; + virtual float GetAngle2() const = 0; + virtual float GetAngleRate1() const = 0; + virtual float GetAngleRate2() const = 0; + virtual void SetParameter(int parameter, float value) = 0; + virtual float GetParameter(int parameter) const = 0; +}; + +} //namespace oxygen + +#endif //OXYGEN_UNIVERSALJOINTINT_H Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -19,6 +19,7 @@ */ #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/rigidbody.h> +#include <oxygen/physicsserver/ode/odejoint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -31,6 +32,7 @@ mJointMaxSpeed1(0), mJointMaxSpeed2(0), mIsLimitJointMaxSpeed1(false), mIsLimitJointMaxSpeed2(false) { + mJointImp = boost::shared_ptr<ODEJoint>(new ODEJoint()); } Joint::~Joint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-12-15 11:29:57 UTC (rev 121) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -29,8 +29,9 @@ namespace oxygen { class RigidBody; +class JointInt; -/** \class Joint encapsulates an ODE joint object. A joint is a +/** \class Joint encapsulates a joint object. A joint is a relationship (a constraint) that is enforced between two bodies so that they can only have certain positions and orientations relative to each other. @@ -67,7 +68,7 @@ Joint(); virtual ~Joint(); - /** destroy the managed ODE object */ + /** destroy the managed physics object */ virtual void DestroyPhysicsObject(); /** attaches the joint to some new bodies. If the joint is already @@ -94,8 +95,8 @@ /** returns the Joint node corresponding to the given joint */ static boost::shared_ptr<Joint> GetJoint(long jointID); - /** returns the type of the managed ODE joint, possible return - values are dJointTypeNone, dJointTypeBall, dJointTypeHinge, + /** returns the type of the managed joint, possible return + values from ODE are dJointTypeNone, dJointTypeBall, dJointTypeHinge, dJointTypeSlider, dJointTypeContact, dJointTypeUniversal, dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor. */ @@ -243,7 +244,7 @@ /** sets the maximum force or torque that the motor will use to achieve the desired velocity. This must always be greater than or equal to zero. Setting this to zero (the default value) - turns off the motor + turns off the motor. */ void SetMaxMotorForce(EAxisIndex idx, float f); @@ -277,14 +278,14 @@ bool IsLimitJointMaxSpeed2() const; protected: - /** associated the created ODE joint with this node */ + /** associates the created joint with this node */ virtual void OnLink(); - /** get the node at 'path' and tries a cast to Body */ + /** gets the node at 'path' and tries a cast to Body */ boost::shared_ptr<RigidBody> GetBody(const std::string& path); protected: - /** the managed ODE joint */ + /** the ID of the managed joint */ dJointID mODEJoint; /** the allocated joint feedback structure */ @@ -298,6 +299,9 @@ /** The maximum joint speed in rad, valid only for universaljoint */ float mJointMaxSpeed2; bool mIsLimitJointMaxSpeed2; + +private: + boost::shared_ptr<JointInt> mJointImp; }; DECLARE_ABSTRACTCLASS(Joint); Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,57 @@ +/* -*- 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: balljoint.cpp 112 2009-12-02 10:06:02Z a-held $ + + 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/odeballjoint.h> +#include <oxygen/physicsserver/balljoint.h> + +using namespace oxygen; +using namespace boost; +using namespace salt; + +ODEBallJoint::ODEBallJoint() : ODEGeneric6DOFJoint() +{ +} + +void ODEBallJoint::CreateBallJoint(long world) +{ + mODEJoint = dJointCreateBall((dWorldID) world, 0); +} + +void ODEBallJoint::SetAnchor(const Vector3f& gAnchor) +{ + dJointSetBallAnchor (mODEJoint, gAnchor[0], gAnchor[1], gAnchor[2]); +} + +Vector3f ODEBallJoint::GetAnchor1() +{ + dReal anchor[3]; + dJointGetBallAnchor (mODEJoint, anchor); + Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); + + return pos; +} + +Vector3f ODEBallJoint::GetAnchor2() +{ + dReal anchor[3]; + dJointGetBallAnchor2(mODEJoint, anchor); + Vector3f pos = Vector3f(anchor[0],anchor[1],anchor[2]); + + return pos; +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeballjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,45 @@ +/* -*- 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: space.h 102 2009-11-18 07:24:29Z a-held $ + + 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_ODEBALLJOINT_H +#define OXYGEN_ODEBALLJOINT_H + +#include <oxygen/physicsserver/int/balljointint.h> +#include <oxygen/physicsserver/ode/odegeneric6dofjoint.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen +{ + +class OXYGEN_API ODEBallJoint : public BallJointInt, public ODEGeneric6DOFJoint +{ +public: + ODEBallJoint(); + void SetAnchor(const salt::Vector3f& anchor); + salt::Vector3f GetAnchor1(); + salt::Vector3f GetAnchor2(); + void CreateBallJoint(long world); +}; + +} //namespace oxygen + +#endif //OXYGEN_BALLJOINTINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,28 @@ +/* -*- 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/odeconetwistjoint.h> + +using namespace oxygen; + +ODEConeTwistJoint::ODEConeTwistJoint() : ODEGeneric6DOFJoint(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconetwistjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,40 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODECONETWISTJOINT_H +#define OXYGEN_ODECONETWISTJOINT_H + +#include <oxygen/physicsserver/ode/odegeneric6dofjoint.h> +#include <oxygen/physicsserver/int/conetwistjointint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEConeTwistJoint : public ConeTwistJointInt, public ODEGeneric6DOFJoint +{ + +public: + ODEConeTwistJoint(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODECONETWISTJOINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,38 @@ +/* -*- 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: fixedjoint.cpp 112 2009-12-02 10:06:02Z a-held $ + + 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/odefixedjoint.h> + +using namespace oxygen; +using namespace boost; + +ODEFixedJoint::ODEFixedJoint() : ODEGeneric6DOFJoint() +{ +} + +void ODEFixedJoint::CreateFixedJoint(long world) +{ + mODEJoint = dJointCreateFixed((dWorldID) world, 0); +} + +void ODEFixedJoint::SetFixed() +{ + dJointSetFixed(mODEJoint); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,39 @@ +/* -*- 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: fixedjoint.h 108 2009-11-25 10:20:10Z a-held $ + + 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_ODEFIXEDJOINT_H +#define OXYGEN_ODEFIXEDJOINT_H + +#include <oxygen/physicsserver/ode/odegeneric6dofjoint.h> +#include <oxygen/physicsserver/int/fixedjointint.h> +#include <oxygen/oxygen_defines.h> + +namespace oxygen{ + +class OXYGEN_API ODEFixedJoint : public FixedJointInt, public ODEGeneric6DOFJoint{ + +public: + ODEFixedJoint(); + void CreateFixedJoint(long world); + void SetFixed(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEFIXEDJOINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,28 @@ +/* -*- 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/odegeneric6dofjoint.h> + +using namespace oxygen; + +ODEGeneric6DOFJoint::ODEGeneric6DOFJoint() : ODEJoint(){ + +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.h (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odegeneric6dofjoint.h 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,39 @@ +/* -*- 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. +*/ +#ifndef OXYGEN_ODEGENERIC6DOFJOINT_H +#define OXYGEN_ODEGENERIC6DOFJOINT_H + +#include <oxygen/physicsserver/ode/odejoint.h> +#include <oxygen/physicsserver/int/generic6dofjointint.h> + +namespace oxygen +{ + +class OXYGEN_API ODEGeneric6DOFJoint : public Generic6DOFJointInt, public ODEJoint +{ +public: + ODEGeneric6DOFJoint(); +}; + +} //namespace oxygen + +#endif //OXYGEN_ODEGENERIC6DOFJOINT_H Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp 2009-12-16 10:43:50 UTC (rev 122) @@ -0,0 +1,84 @@ +/* -*- 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: hinge2joint.cpp 112 2009-12-02 10:06:02Z a-held $ + + 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/odehinge2joint.h> + +using namespace oxygen; +using namespace boost; +using namespace salt; + +ODEHinge2Joint::ODEHinge2Joint() : ODEGeneric6DOFJoint() +{ +} + +void ODEHinge2Joint::CreateHinge2Joint(long world) +{ + mODEJoint = dJointCreateHinge2((dWorldID) world, 0); +... [truncated message content] |
From: <a-...@us...> - 2010-01-08 07:35:37
|
Revision: 138 http://simspark.svn.sourceforge.net/simspark/?rev=138&view=rev Author: a-held Date: 2010-01-08 07:35:25 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Implemented bridge pattern for Joint superclass Created separate file for engine-specific static methods Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/genericphysicsobjects.h branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods.h branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods_ode.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-08 07:35:25 UTC (rev 138) @@ -39,6 +39,7 @@ physicsserver/recorderhandler.h physicsserver/space.h physicsserver/spherecollider.h + physicsserver/staticphysicsmethods.h physicsserver/transformcollider.h physicsserver/world.h physicsserver/dragcontroller.h @@ -89,6 +90,7 @@ physicsserver/int/worldint.h #ode-specific files + physicsserver/staticphysicsmethods_ode.cpp physicsserver/ode/odeballjoint.h physicsserver/ode/odebody.h physicsserver/ode/odeboxcollider.h Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -77,15 +77,12 @@ return GetLocalPos(pos); } -void BallJoint::SetParameter(int /*parameter*/, float /*value*/) -{ - GetLog()->Error() << - "(BallJoint) WARNING: SetParameter function undefined for BallJoint, ignored\n"; +void BallJoint::SetParameter(int parameter, float value){ + GetLog()->Warning() + << "(BallJoint) WARNING: SetParameter undefined for BallJoint, call ignored"; } -float BallJoint::GetParameter(int /*parameter*/) const -{ - GetLog()->Error() << - "(BallJoint) WARNING: GetParameter function undefined for BallJoint, returned zero\n"; - return 0; +float BallJoint::GetParameter(int parameter) const{ + GetLog()->Warning() + << "(BallJoint) WARNING: SetParameter undefined for BallJoint, call ignored"; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -44,16 +44,16 @@ anchor point will be the same for both bodies. */ salt::Vector3f GetAnchor(EBodyIndex idx); + + /** sets a joint parameter value */ + virtual void SetParameter(int parameter, float value); + /** returns a joint parameter value */ + virtual float GetParameter(int parameter) const; + protected: /** creates a new contact joint */ virtual void OnLink(); - - /** sets a joint parameter value */ - virtual void SetParameter(int parameter, float value); - - /** returns a joint parameter value */ - virtual float GetParameter(int parameter) const; private: boost::shared_ptr<BallJointInt> mBallJointImp; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -23,6 +23,7 @@ #include <oxygen/physicsserver/ode/odecollider.h> #include <oxygen/physicsserver/collisionhandler.h> #include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/staticphysicsmethods.h> #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/rigidbody.h> #include <oxygen/sceneserver/scene.h> @@ -163,7 +164,7 @@ } Collider* collPtr = - ColliderInt::GetColliderPointer(geomID); + StaticPhysicsMethods::GetColliderPointer(geomID); if (collPtr == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/genericphysicsobjects.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/genericphysicsobjects.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/genericphysicsobjects.h 2010-01-08 07:35:25 UTC (rev 138) @@ -37,6 +37,7 @@ class OXYGEN_API GenericPhysicsMatrix{}; class OXYGEN_API GenericContact{}; class OXYGEN_API GenericMass{}; +class OXYGEN_API GenericJointFeedback{}; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -113,13 +113,3 @@ return 0; } } - -void Hinge2Joint::SetParameter(int parameter, float value) -{ - mHinge2JointImp->SetParameter(parameter, value, mJointID); -} - -float Hinge2Joint::GetParameter(int parameter) const -{ - return mHinge2JointImp->GetParameter(parameter, mJointID); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -57,12 +57,6 @@ protected: /** creates a new hinge2 joint */ virtual void OnLink(); - - /** sets a joint parameter value */ - virtual void SetParameter(int parameter, float value); - - /** returns a joint parameter value */ - virtual float GetParameter(int parameter) const; private: boost::shared_ptr<Hinge2JointInt> mHinge2JointImp; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -125,12 +125,6 @@ return mHingeJointImp->GetAngleRate(mJointID); } -void HingeJoint::SetParameter(int parameter, float value) -{ - mHingeJointImp->SetParameter(parameter, value, mJointID); +void HingeJoint::SetParameter(int parameter, float value){ + mJointImp->SetParameter(parameter, value, mJointID); } - -float HingeJoint::GetParameter(int parameter) const -{ - return mHingeJointImp->GetParameter(parameter, mJointID); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -68,13 +68,10 @@ /** returns the time derivate of the hinge angle */ float GetAngleRate() const; + + /** Sets a parameter value of this joint*/ + void SetParameter(int parameter, float value); - /** sets a joint parameter value */ - virtual void SetParameter(int parameter, float value); - - /** returns a joint parameter value */ - virtual float GetParameter(int parameter) const; - protected: /** creates a new hingejoint joint */ virtual void OnLink(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -48,15 +48,6 @@ virtual void SetSpace(long spaceID, long geomID, Collider* collider) = 0; virtual void SetBody(long bodyID, long geomID) = 0; virtual void RemoveFromSpace(long geomID, long spaceID) = 0; - - // Here, we have to cheat with the preprocessor, since a static method - // is required, and the bridge pattern requires member variables to - // be used (so we cannot use the bridge pattern) - static Collider* GetColliderPointer(long geomID){ - #ifdef OXYGEN_ODEWRAPPER_H - return static_cast<Collider*>(dGeomGetData( (dGeomID) geomID)); - #endif - } }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -38,8 +38,6 @@ virtual float GetAngle(long jointID) = 0; virtual float GetAngleRate1(long jointID) = 0; virtual float GetAngleRate2(long jointID) = 0; - virtual void SetParameter(int parameter, float value, long jointID) = 0; - virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -36,8 +36,6 @@ virtual salt::Vector3f GetAxis(long jointID) = 0; virtual float GetAngle(long jointID) const = 0; virtual float GetAngleRate(long jointID) const = 0; - virtual void SetParameter(int parameter, float value, long jointID) = 0; - virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -23,6 +23,7 @@ #ifndef OXYGEN_JOINTINT_H #define OXYGEN_JOINTINT_H +#include <oxygen/physicsserver/genericphysicsobjects.h> #include <oxygen/physicsserver/ode/odewrapper.h> #include <boost/smart_ptr/shared_ptr.hpp> #include <salt/vector.h> @@ -36,89 +37,47 @@ class OXYGEN_API JointInt { -public: - enum EBodyIndex - { - BI_FIRST = 0, - BI_SECOND = 1 - }; - - enum EAxisIndex - { - AI_FIRST = 0, - AI_SECOND = 1, - AI_THIRD = 2 - }; - - static Joint* GetJoint(long jointID){ +public: - } - - static bool AreConnected(boost::shared_ptr<RigidBody> body1, - boost::shared_ptr<RigidBody> body2){ - - } - - static bool AreConnectedExcluding(boost::shared_ptr<RigidBody> body1, - boost::shared_ptr<RigidBody> body2, - int joint_type){ - - } - - virtual void DestroyJoint() = 0; - virtual void Attach(boost::shared_ptr<RigidBody> body1, - boost::shared_ptr<RigidBody> body2) = 0; - virtual void Attach(const std::string& path1, const std::string& path2) = 0; - virtual int GetType() const = 0; - virtual boost::shared_ptr<RigidBody> GetBody(EBodyIndex idx) = 0; - virtual void EnableFeedback(bool enable) = 0; - virtual bool FeedbackEnabled() const = 0; - virtual salt::Vector3f GetFeedbackForce(EBodyIndex idx) const = 0; - virtual salt::Vector3f GetFeedbackTorque(EBodyIndex idx) const = 0; - virtual void SetFudgeFactor(EAxisIndex idx, float fudge_factor) = 0; - virtual float GetFudgeFactor(EAxisIndex idx) const = 0; - virtual void SetBounce(EAxisIndex idx, float bounce) = 0; - virtual float GetBounce(EAxisIndex idx) const = 0; - virtual void SetLowStopDeg(EAxisIndex idx, float deg) = 0; - virtual float GetLowStopDeg(EAxisIndex idx) const = 0; - virtual void SetHighStopDeg(EAxisIndex idx, float deg) = 0; - virtual float GetHighStopDeg(EAxisIndex idx) const = 0; - virtual void SetLowStopPos(EAxisIndex idx, float deg) = 0; - virtual float GetLowStopPos(EAxisIndex idx) const = 0; - virtual void SetHighStopPos(EAxisIndex idx, float deg) = 0; - virtual float GetHighStopPos(EAxisIndex idx) const = 0; - virtual void SetCFM(EAxisIndex idx, float cfm) = 0; - virtual float GetCFM(EAxisIndex idx) const = 0; - virtual void SetStopCFM(EAxisIndex idx, float cfm) = 0; - virtual float GetStopCFM(EAxisIndex idx) const = 0; - virtual void SetStopERP(EAxisIndex idx, float erp) = 0; - virtual float GetStopERP(EAxisIndex idx) const = 0; - virtual void SetSuspensionERP(EAxisIndex idx, float erp) = 0; - virtual float GetSuspensionERP(EAxisIndex idx) const = 0; - virtual void SetSuspensionCFM(EAxisIndex idx, float cfm) = 0; - virtual float GetSuspensionCFM(EAxisIndex idx) const = 0; - virtual void SetLinearMotorVelocity(EAxisIndex idx, float vel) = 0; - virtual float GetLinearMotorVelocity(EAxisIndex idx) const = 0; - virtual void SetAngularMotorVelocity(EAxisIndex idx, float deg) = 0; - virtual float GetAngularMotorVelocity(EAxisIndex idx) const = 0; - virtual void SetMaxMotorForce(EAxisIndex idx, float f) = 0; - virtual float GetMaxMotorForce(EAxisIndex idx) const = 0; - virtual void SetParameter(int parameter, float value) = 0; - virtual float GetParameter(int parameter) const = 0; - virtual void SetJointMaxSpeed1(float rad) = 0; - virtual void SetJointMaxSpeed2(float rad) = 0; - virtual float GetJointMaxSpeed1() const = 0; - virtual float GetJointMaxSpeed2() const = 0; - virtual bool IsLimitJointMaxSpeed1() const = 0; - virtual bool IsLimitJointMaxSpeed2() const = 0; - virtual void OnLink() = 0; - -protected: - boost::shared_ptr<dJointFeedback> mFeedback; - float mJointMaxSpeed1; - bool mIsLimitJointMaxSpeed1; - float mJointMaxSpeed2; - bool mIsLimitJointMaxSpeed2; + virtual void DestroyJoint(long jointID) = 0; + virtual void Attach(long bodyID1, long bodiID2, long jointID) = 0; + virtual int GetType(long jointID) const = 0; + virtual long GetBodyID(int idx, long jointID) = 0; + virtual void EnableFeedback(bool enable, long jointID) = 0; + virtual bool FeedbackEnabled(long jointID) const = 0; + virtual salt::Vector3f GetFeedbackForce(int idx) const = 0; + virtual salt::Vector3f GetFeedbackTorque(int idx) const = 0; + virtual void SetFudgeFactor(int idx, float fudge_factor, long jointID) = 0; + virtual float GetFudgeFactor(int idx, long jointID) const = 0; + virtual void SetBounce(int idx, float bounce, long jointID) = 0; + virtual float GetBounce(int idx, long jointID) const = 0; + virtual void SetLowStopDeg(int idx, float deg, long jointID) = 0; + virtual float GetLowStopDeg(int idx, long jointID) const = 0; + virtual void SetHighStopDeg(int idx, float deg, long jointID) = 0; + virtual float GetHighStopDeg(int idx, long jointID) const = 0; + virtual void SetLowStopPos(int idx, float deg, long jointID) = 0; + virtual float GetLowStopPos(int idx, long jointID) const = 0; + virtual void SetHighStopPos(int idx, float deg, long jointID) = 0; + virtual float GetHighStopPos(int idx, long jointID) const = 0; + virtual void SetCFM(int idx, float cfm, long jointID) = 0; + virtual float GetCFM(int idx, long jointID) const = 0; + virtual void SetStopCFM(int idx, float cfm, long jointID) = 0; + virtual float GetStopCFM(int idx, long jointID) const = 0; + virtual void SetStopERP(int idx, float erp, long jointID) = 0; + virtual float GetStopERP(int idx, long jointID) const = 0; + virtual void SetSuspensionERP(int idx, float erp, long jointID) = 0; + virtual float GetSuspensionERP(int idx, long jointID) const = 0; + virtual void SetSuspensionCFM(int idx, float cfm, long jointID) = 0; + virtual float GetSuspensionCFM(int idx, long jointID) const = 0; + virtual void SetLinearMotorVelocity(int idx, float vel, long jointID) = 0; + virtual float GetLinearMotorVelocity(int idx, long jointID) const = 0; + virtual void SetAngularMotorVelocity(int idx, float deg, long jointID) = 0; + virtual float GetAngularMotorVelocity(int idx, long jointID) const = 0; + virtual void SetMaxMotorForce(int idx, float f, long jointID) = 0; + virtual float GetMaxMotorForce(int idx, long jointID) const = 0; + virtual void SetParameter(int parameter, float value, long jointID) = 0; + virtual float GetParameter(int parameter, long jointID) const = 0; + virtual void OnLink(long jointID, Joint* joint) = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -81,17 +81,7 @@ virtual void DestroyPhysicsObject(long bodyID) = 0; virtual salt::Matrix GetSynchronisationMatrix(long bodyID) = 0; virtual void BodySetData(RigidBody* rb, long bodyID) = 0; - virtual RigidBody* BodyGetData(long bodyID) = 0; - - // Here, we have to cheat with the preprocessor, since a static method - // is required, and the bridge pattern requires member variables to - // be used (so we cannot use the bridge pattern) - static RigidBody* GetBodyPointer(long bodyID){ - #ifdef OXYGEN_ODEWRAPPER_H - return static_cast<RigidBody*>(dBodyGetData( (dBodyID) bodyID)); - #endif - } - + virtual RigidBody* BodyGetData(long bodyID) = 0; virtual long CreateBody(long world) = 0; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -37,8 +37,6 @@ virtual float GetPosition(long jointID) = 0; virtual float GetPositionRate(long jointID) = 0; virtual void SetSliderAxis(salt::Vector3f& up, long jointID) = 0; - virtual void SetParameter(int parameter, float value, long jointID) = 0; - virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -45,8 +45,6 @@ virtual float GetAngle2(long jointID) const = 0; virtual float GetAngleRate1(long jointID) const = 0; virtual float GetAngleRate2(long jointID) const = 0; - virtual void SetParameter(int parameter, float value, long jointID) = 0; - virtual float GetParameter(int parameter, long jointID) const = 0; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -19,6 +19,7 @@ */ #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/rigidbody.h> +#include <oxygen/physicsserver/staticphysicsmethods.h> #include <oxygen/physicsserver/ode/odejoint.h> #include <zeitgeist/logserver/logserver.h> @@ -46,7 +47,7 @@ return; } - dJointSetData( (dJointID) mJointID, this); + mJointImp->OnLink(mJointID, this); } shared_ptr<Joint> Joint::GetJoint(long jointID) @@ -56,8 +57,7 @@ return shared_ptr<Joint>(); } - Joint* jointPtr = - static_cast<Joint*>(dJointGetData((dJointID) jointID)); + Joint* jointPtr = StaticPhysicsMethods::GetJoint(jointID); if (jointPtr == 0) { @@ -117,7 +117,7 @@ GetLog()->Debug() << "(Joint) Attaching '" << path1 << "' to '" << path2 << '\n'; - dJointAttach( (dJointID) mJointID, (dBodyID) id1, (dBodyID) id2); + mJointImp->Attach(id1, id2, mJointID); } shared_ptr<RigidBody> Joint::GetBody(const std::string& path) @@ -162,16 +162,16 @@ int Joint::GetType() const { - return dJointGetType( (dJointID) mJointID); + return mJointImp->GetType(mJointID); } boost::shared_ptr<RigidBody> Joint::GetBody(EBodyIndex idx) { - long bodyID = (long) dJointGetBody( (dJointID) mJointID, idx); + long bodyID = mJointImp->GetBodyID(idx, mJointID); return RigidBody::GetBody(bodyID); } -bool Joint::AreConnected (shared_ptr<RigidBody> body1, shared_ptr<RigidBody> body2) +bool Joint::AreConnected(shared_ptr<RigidBody> body1, shared_ptr<RigidBody> body2) { if ( (body1.get() == 0) || @@ -181,9 +181,7 @@ return false; } - const bool connected = - (dAreConnected((dBodyID) body1->GetBodyID(), (dBodyID) body2->GetBodyID()) - == 1); + const bool connected = StaticPhysicsMethods::AreConnected(body1->GetBodyID(), body2->GetBodyID()); return connected; } @@ -200,238 +198,172 @@ return false; } - const bool connected = - (dAreConnectedExcluding((dBodyID) body1->GetBodyID(), - (dBodyID) body2->GetBodyID(), - joint_type - ) - == 1); + const bool connected = + StaticPhysicsMethods::AreConnectedExcluding(body1->GetBodyID(), + body2->GetBodyID(), + joint_type); return connected; } void Joint::EnableFeedback(bool enable) { - if (enable) - { - if (mFeedback.get() == 0) - { - mFeedback = shared_ptr<dJointFeedback>(new dJointFeedback()); - memset(mFeedback.get(),0,sizeof(dJointFeedback)); - } - } else - { - if (mFeedback.get() != 0) - { - mFeedback.reset(); - } - } - - dJointSetFeedback( (dJointID) mJointID,mFeedback.get()); + mJointImp->EnableFeedback(enable, mJointID); } bool Joint::FeedBackEnabled() const { - return (dJointGetFeedback( (dJointID) mJointID) != 0); + return mJointImp->FeedbackEnabled(mJointID); } Vector3f Joint::GetFeedbackForce(EBodyIndex idx) const { - dJointFeedback* fb = mFeedback.get(); - if (fb == 0) - { - return Vector3f(0,0,0); - } - - switch (idx) - { - case BI_FIRST : - return Vector3f( - fb->f1[0], - fb->f1[1], - fb->f1[2] - ); - - case BI_SECOND : - return Vector3f( - fb->f2[0], - fb->f2[1], - fb->f2[2] - ); - - default: - return Vector3f(0,0,0); - } + return mJointImp->GetFeedbackForce(idx); } Vector3f Joint::GetFeedbackTorque(EBodyIndex idx) const { - dJointFeedback* fb = mFeedback.get(); - if (fb == 0) - { - return Vector3f(0,0,0); - } - - switch (idx) - { - case BI_FIRST : - return Vector3f( - fb->t1[0], - fb->t1[1], - fb->t1[2] - ); - - case BI_SECOND : - return Vector3f( - fb->t2[0], - fb->t2[1], - fb->t2[2] - ); - - default: - return Vector3f(0,0,0); - } + return mJointImp->GetFeedbackTorque(idx); } void Joint::SetFudgeFactor(EAxisIndex idx, float fudge_factor) { - SetParameter(dParamFudgeFactor + (idx * dParamGroup), fudge_factor); + mJointImp->SetFudgeFactor(idx, fudge_factor, mJointID); } float Joint::GetFudgeFactor(EAxisIndex idx) const { - return GetParameter(dParamFudgeFactor + (idx * dParamGroup)); + return mJointImp->GetFudgeFactor(idx, mJointID); } - void Joint::SetBounce(EAxisIndex idx, float bounce) { - SetParameter(dParamBounce + (idx * dParamGroup),bounce); + mJointImp->SetBounce(idx, bounce, mJointID); } float Joint::GetBounce(EAxisIndex idx) const { - return GetParameter(dParamBounce + (idx * dParamGroup)); + return mJointImp->GetBounce(idx, mJointID); } void Joint::SetLowStopPos(EAxisIndex idx, float pos) { - SetParameter(dParamLoStop + (idx * dParamGroup), pos); + mJointImp->SetLowStopPos(idx, pos, mJointID); } float Joint::GetLowStopPos(EAxisIndex idx) const { - return GetParameter(dParamLoStop + (idx * dParamGroup)); + return mJointImp->GetLowStopPos(idx, mJointID); } void Joint::SetHighStopPos(EAxisIndex idx, float pos) { - SetParameter(dParamHiStop + (idx * dParamGroup), pos); + mJointImp->SetHighStopPos(idx, pos, mJointID); } float Joint::GetHighStopPos(EAxisIndex idx) const { - return GetParameter(dParamHiStop + (idx * dParamGroup)); + return mJointImp->GetHighStopPos(idx, mJointID); } void Joint::SetLowStopDeg(EAxisIndex idx, float deg) { - SetParameter(dParamLoStop + (idx * dParamGroup), gDegToRad(deg)); + mJointImp->SetLowStopDeg(idx, deg, mJointID); } float Joint::GetLowStopDeg(EAxisIndex idx) const { - return gRadToDeg(GetParameter(dParamLoStop + (idx * dParamGroup))); + return mJointImp->GetLowStopDeg(idx, mJointID); } void Joint::SetHighStopDeg(EAxisIndex idx, float deg) { - SetParameter(dParamHiStop + (idx * dParamGroup), gDegToRad(deg)); + mJointImp->SetHighStopDeg(idx, deg, mJointID); } float Joint::GetHighStopDeg(EAxisIndex idx) const { - return gRadToDeg(GetParameter(dParamHiStop + (idx * dParamGroup))); + return mJointImp->GetHighStopDeg(idx, mJointID); } void Joint::SetCFM(EAxisIndex idx, float cfm) { - SetParameter(dParamCFM + (idx * dParamGroup), cfm); + mJointImp->SetCFM(idx, cfm, mJointID); } float Joint::GetCFM(EAxisIndex idx) const { - return GetParameter(dParamCFM + (idx * dParamGroup)); + return mJointImp->GetCFM(idx, mJointID); } void Joint::SetStopCFM(EAxisIndex idx, float cfm) { - SetParameter(dParamStopCFM + (idx * dParamGroup), cfm); + mJointImp->SetStopCFM(idx, cfm, mJointID); } float Joint::GetStopCFM(EAxisIndex idx) const { - return GetParameter(dParamStopCFM + (idx * dParamGroup)); + return mJointImp->GetStopCFM(idx, mJointID); } void Joint::SetStopERP(EAxisIndex idx, float erp) { - SetParameter(dParamStopERP + (idx * dParamGroup), erp); + mJointImp->SetStopERP(idx, erp, mJointID); } float Joint::GetStopERP(EAxisIndex idx) const { - return GetParameter(dParamStopERP + (idx * dParamGroup)); + return mJointImp->GetStopERP(idx, mJointID); } void Joint::SetSuspensionERP(EAxisIndex idx, float erp) { - SetParameter(dParamSuspensionERP + (idx * dParamGroup), erp); + mJointImp->SetSuspensionERP(idx, erp, mJointID); } float Joint::GetSuspensionERP(EAxisIndex idx) const { - return GetParameter(dParamSuspensionERP + (idx * dParamGroup)); + return mJointImp->GetSuspensionERP(idx, mJointID); } void Joint::SetSuspensionCFM(EAxisIndex idx, float cfm) { - SetParameter(dParamSuspensionCFM + (idx * dParamGroup), cfm); + mJointImp->SetSuspensionCFM(idx, cfm, mJointID); } float Joint::GetSuspensionCFM(EAxisIndex idx) const { - return GetParameter(dParamSuspensionCFM + (idx * dParamGroup)); + return mJointImp->GetSuspensionCFM(idx, mJointID); } void Joint::SetLinearMotorVelocity(EAxisIndex idx, float vel) { - SetParameter(dParamVel + (idx * dParamGroup), vel); + mJointImp->SetLinearMotorVelocity(idx, vel, mJointID); } float Joint::GetLinearMotorVelocity(EAxisIndex idx) const { - return GetParameter(dParamVel + (idx * dParamGroup)); + return mJointImp->GetLinearMotorVelocity(idx, mJointID); } void Joint::SetAngularMotorVelocity(EAxisIndex idx, float deg) { - SetParameter(dParamVel + (idx * dParamGroup), gDegToRad(deg)); + mJointImp->SetAngularMotorVelocity(idx, deg, mJointID); } float Joint::GetAngularMotorVelocity(EAxisIndex idx) const { - return gRadToDeg(GetParameter(dParamVel + (idx * dParamGroup))); + return mJointImp->GetAngularMotorVelocity(idx, mJointID); } void Joint::SetMaxMotorForce(EAxisIndex idx, float f) { - SetParameter(dParamFMax + (idx * dParamGroup), f); + mJointImp->SetMaxMotorForce(idx, f, mJointID); } float Joint::GetMaxMotorForce(EAxisIndex idx) const { - return GetParameter(dParamFMax + (idx * dParamGroup)); + return mJointImp->GetMaxMotorForce(idx, mJointID); } void Joint::DestroyPhysicsObject() @@ -442,7 +374,7 @@ } EnableFeedback(false); - dJointDestroy( (dJointID) mJointID); + mJointImp->DestroyJoint(mJointID); mJointID = 0; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -25,6 +25,7 @@ #include <oxygen/oxygen_defines.h> #include <oxygen/physicsserver/ode/odewrapper.h> #include <oxygen/physicsserver/physicsobject.h> +#include <oxygen/physicsserver/genericphysicsobjects.h> namespace oxygen { @@ -253,12 +254,6 @@ */ float GetMaxMotorForce(EAxisIndex idx) const; - /** sets a joint parameter value */ - virtual void SetParameter(int parameter, float value) = 0; - - /** returns a joint parameter value */ - virtual float GetParameter(int parameter) const = 0; - /** Set the maximum joint speed1, valid for both hingejoint and universaljoint */ virtual void SetJointMaxSpeed1(float rad); @@ -288,9 +283,6 @@ /** the ID of the managed joint */ long mJointID; - /** the allocated joint feedback structure */ - boost::shared_ptr<dJointFeedback> mFeedback; - protected: /** The maximum joint speed in rad, valid for both hingejoint and universaljoint */ float mJointMaxSpeed1; @@ -300,7 +292,6 @@ float mJointMaxSpeed2; bool mIsLimitJointMaxSpeed2; -private: boost::shared_ptr<JointInt> mJointImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odefixedjoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -30,8 +30,8 @@ long ODEFixedJoint::CreateFixedJoint(long world) { dWorldID ODEworld = (dWorldID) world; - mODEJoint = dJointCreateFixed(ODEworld, 0); - return (long) mODEJoint; + dJointID ODEJoint = dJointCreateFixed(ODEworld, 0); + return (long) ODEJoint; } void ODEFixedJoint::SetFixed(long jointID) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -81,15 +81,3 @@ dJointID ODEJoint = (dJointID) jointID; return gRadToDeg(dJointGetHinge2Angle2Rate(ODEJoint)); } - -void ODEHinge2Joint::SetParameter(int parameter, float value, long jointID) -{ - dJointID ODEJoint = (dJointID) jointID; - dJointSetHinge2Param(ODEJoint, parameter, value); -} - -float ODEHinge2Joint::GetParameter(int parameter, long jointID) const -{ - dJointID ODEJoint = (dJointID) jointID; - return dJointGetHinge2Param(ODEJoint, parameter); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehinge2joint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -40,8 +40,6 @@ float GetAngle(long jointID); float GetAngleRate1(long jointID); float GetAngleRate2(long jointID); - void SetParameter(int parameter, float value, long jointID); - float GetParameter(int parameter, long jointID) const; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -85,15 +85,3 @@ dJointID ODEJoint = (dJointID) jointID; return gRadToDeg(dJointGetHingeAngleRate(ODEJoint)); } - -void ODEHingeJoint::SetParameter(int parameter, float value, long jointID) -{ - dJointID ODEJoint = (dJointID) jointID; - dJointSetHingeParam(ODEJoint, parameter, value); -} - -float ODEHingeJoint::GetParameter(int parameter, long jointID) const -{ - dJointID ODEJoint = (dJointID) jointID; - return dJointGetHingeParam(ODEJoint, parameter); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odehingejoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -38,8 +38,6 @@ salt::Vector3f GetAxis(long jointID); float GetAngle(long jointID) const; float GetAngleRate(long jointID) const; - void SetParameter(int parameter, float value, long jointID); - float GetParameter(int parameter, long jointID) const; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -26,72 +26,41 @@ using namespace std; using namespace salt; -ODEJoint::ODEJoint() : ODEPhysicsObject(), mODEJoint(0) +ODEJoint::ODEJoint() : ODEPhysicsObject() { - mJointMaxSpeed1 = mJointMaxSpeed2 = 0.0; - mIsLimitJointMaxSpeed1 = mIsLimitJointMaxSpeed2 = false; } -void ODEJoint::OnLink() +void ODEJoint::OnLink(long jointID, Joint* joint) { - if (mODEJoint == 0) - { - return; - } - - dJointSetData(mODEJoint, this); + dJointID ODEJoint = (dJointID) jointID; + dJointSetData(ODEJoint, joint); } -void ODEJoint::Attach(shared_ptr<RigidBody> body1, shared_ptr<RigidBody> body2) +void ODEJoint::Attach(long bodyID1, long bodyID2, long jointID) { - string path1,path2; - long id1,id2; - - static const char strStaticEnv[] = "<static environment>"; - - if (body1.get() == 0) - { - id1 = 0; - path1 = strStaticEnv; - } else - { - id1 = body1->GetBodyID(); - path1 = body1->GetFullPath(); - } - - if (body2.get() == 0) - { - id2 = 0; - path2 = strStaticEnv; - } else - { - id2 = body2->GetBodyID(); - path2 = body2->GetFullPath(); - } - - dJointAttach(mODEJoint, (dBodyID) id1, (dBodyID) id2); + dBodyID ODEBody1 = (dBodyID) bodyID1; + dBodyID ODEBody2 = (dBodyID) bodyID2; + dJointID ODEJoint = (dJointID) jointID; + dJointAttach(ODEJoint, ODEBody1, ODEBody2); } -void ODEJoint::Attach(const std::string& path1, const std::string& path2) +int ODEJoint::GetType(long jointID) const { - shared_ptr<RigidBody> body1; - shared_ptr<RigidBody> body2; - Attach(body1,body2); + dJointID ODEJoint = (dJointID) jointID; + return dJointGetType(ODEJoint); } -int ODEJoint::GetType() const +long ODEJoint::GetBodyID(int idx, long jointID) { - return dJointGetType(mODEJoint); + dJointID ODEJoint = (dJointID) jointID; + dBodyID ODEBodyID = dJointGetBody(ODEJoint, idx); + return (long) ODEBodyID; } -boost::shared_ptr<RigidBody> ODEJoint::GetBody(EBodyIndex idx) +void ODEJoint::EnableFeedback(bool enable, long jointID) { - long bodyID = (long) dJointGetBody(mODEJoint, idx); - return RigidBody::GetBody(bodyID); -} - -void ODEJoint::EnableFeedback(bool enable) -{ + dJointID ODEJoint = (dJointID) jointID; + if (enable) { if (mFeedback.get() == 0) @@ -107,15 +76,16 @@ } } - dJointSetFeedback(mODEJoint,mFeedback.get()); + dJointSetFeedback(ODEJoint,mFeedback.get()); } -bool ODEJoint::FeedbackEnabled() const +bool ODEJoint::FeedbackEnabled(long jointID) const { - return (dJointGetFeedback(mODEJoint) != 0); + dJointID ODEJoint = (dJointID) jointID; + return (dJointGetFeedback(ODEJoint) != 0); } -Vector3f ODEJoint::GetFeedbackForce(EBodyIndex idx) const +Vector3f ODEJoint::GetFeedbackForce(int idx) const { dJointFeedback* fb = mFeedback.get(); if (fb == 0) @@ -125,14 +95,14 @@ switch (idx) { - case BI_FIRST : + case 0 : return Vector3f( fb->f1[0], fb->f1[1], fb->f1[2] ); - case BI_SECOND : + case 1 : return Vector3f( fb->f2[0], fb->f2[1], @@ -144,7 +114,7 @@ } } -Vector3f ODEJoint::GetFeedbackTorque(EBodyIndex idx) const +Vector3f ODEJoint::GetFeedbackTorque(int idx) const { dJointFeedback* fb = mFeedback.get(); if (fb == 0) @@ -154,14 +124,14 @@ switch (idx) { - case BI_FIRST : + case 0 : return Vector3f( fb->t1[0], fb->t1[1], fb->t1[2] ); - case BI_SECOND : + case 1 : return Vector3f( fb->t2[0], fb->t2[1], @@ -173,192 +143,181 @@ } } -void ODEJoint::SetFudgeFactor(EAxisIndex idx, float fudge_factor) +void ODEJoint::SetFudgeFactor(int idx, float fudge_factor, long jointID) { - SetParameter(dParamFudgeFactor + (idx * dParamGroup), fudge_factor); + SetParameter(dParamFudgeFactor + (idx * dParamGroup), fudge_factor, jointID); } -float ODEJoint::GetFudgeFactor(EAxisIndex idx) const +float ODEJoint::GetFudgeFactor(int idx, long jointID) const { - return GetParameter(dParamFudgeFactor + (idx * dParamGroup)); + return GetParameter(dParamFudgeFactor + (idx * dParamGroup), jointID); } - -void ODEJoint::SetBounce(EAxisIndex idx, float bounce) +void ODEJoint::SetBounce(int idx, float bounce, long jointID) { - SetParameter(dParamBounce + (idx * dParamGroup),bounce); + SetParameter(dParamBounce + (idx * dParamGroup),bounce, jointID); } -float ODEJoint::GetBounce(EAxisIndex idx) const +float ODEJoint::GetBounce(int idx, long jointID) const { - return GetParameter(dParamBounce + (idx * dParamGroup)); + return GetParameter(dParamBounce + (idx * dParamGroup), jointID); } -void ODEJoint::SetLowStopPos(EAxisIndex idx, float pos) +void ODEJoint::SetLowStopPos(int idx, float pos, long jointID) { - SetParameter(dParamLoStop + (idx * dParamGroup), pos); + SetParameter(dParamLoStop + (idx * dParamGroup), pos, jointID); } -float ODEJoint::GetLowStopPos(EAxisIndex idx) const +float ODEJoint::GetLowStopPos(int idx, long jointID) const { - return GetParameter(dParamLoStop + (idx * dParamGroup)); + return GetParameter(dParamLoStop + (idx * dParamGroup), jointID); } -void ODEJoint::SetHighStopPos(EAxisIndex idx, float pos) +void ODEJoint::SetHighStopPos(int idx, float pos, long jointID) { - SetParameter(dParamHiStop + (idx * dParamGroup), pos); + SetParameter(dParamHiStop + (idx * dParamGroup), pos, jointID); } -float ODEJoint::GetHighStopPos(EAxisIndex idx) const +float ODEJoint::GetHighStopPos(int idx, long jointID) const { - return GetParameter(dParamHiStop + (idx * dParamGroup)); + return GetParameter(dParamHiStop + (idx * dParamGroup), jointID); } -void ODEJoint::SetLowStopDeg(EAxisIndex idx, float deg) +void ODEJoint::SetLowStopDeg(int idx, float deg, long jointID) { - SetParameter(dParamLoStop + (idx * dParamGroup), gDegToRad(deg)); + SetParameter(dParamLoStop + (idx * dParamGroup), gDegToRad(deg), jointID); } -float ODEJoint::GetLowStopDeg(EAxisIndex idx) const +float ODEJoint::GetLowStopDeg(int idx, long jointID) const { - return gRadToDeg(GetParameter(dParamLoStop + (idx * dParamGroup))); + return gRadToDeg(GetParameter(dParamLoStop + (idx * dParamGroup), jointID)); } -void ODEJoint::SetHighStopDeg(EAxisIndex idx, float deg) +void ODEJoint::SetHighStopDeg(int idx, float deg, long jointID) { - SetParameter(dParamHiStop + (idx * dParamGroup), gDegToRad(deg)); + SetParameter(dParamHiStop + (idx * dParamGroup), gDegToRad(deg), jointID); } -float ODEJoint::GetHighStopDeg(EAxisIndex idx) const +float ODEJoint::GetHighStopDeg(int idx, long jointID) const { - return gRadToDeg(GetParameter(dParamHiStop + (idx * dParamGroup))); + return gRadToDeg(GetParameter(dParamHiStop + (idx * dParamGroup), jointID)); } -void ODEJoint::SetCFM(EAxisIndex idx, float cfm) +void ODEJoint::SetCFM(int idx, float cfm, long jointID) { - SetParameter(dParamCFM + (idx * dParamGroup), cfm); + SetParameter(dParamCFM + (idx * dParamGroup), cfm, jointID); } -float ODEJoint::GetCFM(EAxisIndex idx) const +float ODEJoint::GetCFM(int idx, long jointID) const { - return GetParameter(dParamCFM + (idx * dParamGroup)); + return GetParameter(dParamCFM + (idx * dParamGroup), jointID); } -void ODEJoint::SetStopCFM(EAxisIndex idx, float cfm) +void ODEJoint::SetStopCFM(int idx, float cfm, long jointID) { - SetParameter(dParamStopCFM + (idx * dParamGroup), cfm); + SetParameter(dParamStopCFM + (idx * dParamGroup), cfm, jointID); } -float ODEJoint::GetStopCFM(EAxisIndex idx) const +float ODEJoint::GetStopCFM(int idx, long jointID) const { - return GetParameter(dParamStopCFM + (idx * dParamGroup)); + return GetParameter(dParamStopCFM + (idx * dParamGroup), jointID); } -void ODEJoint::SetStopERP(EAxisIndex idx, float erp) +void ODEJoint::SetStopERP(int idx, float erp, long jointID) { - SetParameter(dParamStopERP + (idx * dParamGroup), erp); + SetParameter(dParamStopERP + (idx * dParamGroup), erp, jointID); } -float ODEJoint::GetStopERP(EAxisIndex idx) const +float ODEJoint::GetStopERP(int idx, long jointID) const { - return GetParameter(dParamStopERP + (idx * dParamGroup)); + return GetParameter(dParamStopERP + (idx * dParamGroup), jointID); } -void ODEJoint::SetSuspensionERP(EAxisIndex idx, float erp) +void ODEJoint::SetSuspensionERP(int idx, float erp, long jointID) { - SetParameter(dParamSuspensionERP + (idx * dParamGroup), erp); + SetParameter(dParamSuspensionERP + (idx * dParamGroup), erp, jointID); } -float ODEJoint::GetSuspensionERP(EAxisIndex idx) const +float ODEJoint::GetSuspensionERP(int idx, long jointID) const { - return GetParameter(dParamSuspensionERP + (idx * dParamGroup)); + return GetParameter(dParamSuspensionERP + (idx * dParamGroup), jointID); } -void ODEJoint::SetSuspensionCFM(EAxisIndex idx, float cfm) +void ODEJoint::SetSuspensionCFM(int idx, float cfm, long jointID) { - SetParameter(dParamSuspensionCFM + (idx * dParamGroup), cfm); + SetParameter(dParamSuspensionCFM + (idx * dParamGroup), cfm, jointID); } -float ODEJoint::GetSuspensionCFM(EAxisIndex idx) const +float ODEJoint::GetSuspensionCFM(int idx, long jointID) const { - return GetParameter(dParamSuspensionCFM + (idx * dParamGroup)); + return GetParameter(dParamSuspensionCFM + (idx * dParamGroup), jointID); } -void ODEJoint::SetLinearMotorVelocity(EAxisIndex idx, float vel) +void ODEJoint::SetLinearMotorVelocity(int idx, float vel, long jointID) { - SetParameter(dParamVel + (idx * dParamGroup), vel); + SetParameter(dParamVel + (idx * dParamGroup), vel, jointID); } -float ODEJoint::GetLinearMotorVelocity(EAxisIndex idx) const +float ODEJoint::GetLinearMotorVelocity(int idx, long jointID) const { - return GetParameter(dParamVel + (idx * dParamGroup)); + return GetParameter(dParamVel + (idx * dParamGroup), jointID); } -void ODEJoint::SetAngularMotorVelocity(EAxisIndex idx, float deg) +void ODEJoint::SetAngularMotorVelocity(int idx, float deg, long jointID) { - SetParameter(dParamVel + (idx * dParamGroup), gDegToRad(deg)); + SetParameter(dParamVel + (idx * dParamGroup), gDegToRad(deg), jointID); } -float ODEJoint::GetAngularMotorVelocity(EAxisIndex idx) const +float ODEJoint::GetAngularMotorVelocity(int idx, long jointID) const { - return gRadToDeg(GetParameter(dParamVel + (idx * dParamGroup))); + return gRadToDeg(GetParameter(dParamVel + (idx * dParamGroup), jointID)); } -void ODEJoint::SetMaxMotorForce(EAxisIndex idx, float f) +void ODEJoint::SetMaxMotorForce(int idx, float f, long jointID) { - SetParameter(dParamFMax + (idx * dParamGroup), f); + SetParameter(dParamFMax + (idx * dParamGroup), f, jointID); } -float ODEJoint::GetMaxMotorForce(EAxisIndex idx) const +float ODEJoint::GetMaxMotorForce(int idx, long jointID) const { - return GetParameter(dParamFMax + (idx * dParamGroup)); + return GetParameter(dParamFMax + (idx * dParamGroup), jointID); } -void ODEJoint::DestroyJoint() +void ODEJoint::DestroyJoint(long jointID) { - if (! mODEJoint) - { - return; - } - - EnableFeedback(false); - dJointDestroy(mODEJoint); - mODEJoint = 0; + dJointID ODEJoint = (dJointID) jointID; + EnableFeedback(false, jointID); + dJointDestroy(ODEJoint); } -void ODEJoint::SetJointMaxSpeed1(float rad) -{ - mJointMaxSpeed1 = fabs(rad); - mIsLimitJointMaxSpeed1 = true; +void ODEJoint::SetParameter(int parameter, float value, long jointID){ + dJointID ODEJoint = (dJointID) jointID; + int jointType = dJointGetType(ODEJoint); + switch (jointType){ + case dJointTypeHinge: dJointSetHingeParam(ODEJoint, parameter, value); + break; + case dJointTypeHinge2: dJointSetHinge2Param(ODEJoint, parameter, value); + break; + case dJointTypeSlider: dJointSetSliderParam(ODEJoint, parameter, value); + break; + case dJointTypeUniversal: dJointSetUniversalParam(ODEJoint, parameter, value); + break; + default: return; + } } -void ODEJoint::SetJointMaxSpeed2(float rad) -{ - mJointMaxSpeed2 = fabs(rad); - mIsLimitJointMaxSpeed2 = true; +float ODEJoint::GetParameter(int parameter, long jointID) const{ + dJointID ODEJoint = (dJointID) jointID; + int jointType = dJointGetType(ODEJoint); + switch (jointType){ + case dJointTypeHinge: return dJointGetHingeParam(ODEJoint, parameter); + break; + case dJointTypeHinge2: return dJointGetHinge2Param(ODEJoint, parameter); + break; + case dJointTypeSlider: return dJointGetSliderParam(ODEJoint, parameter); + break; + case dJointTypeUniversal: return dJointGetUniversalParam(ODEJoint, parameter); + break; + default: return 0; + } } - -float ODEJoint::GetJointMaxSpeed1() const -{ - return mJointMaxSpeed1; -} - -float ODEJoint::GetJointMaxSpeed2() const -{ - return mJointMaxSpeed2; -} - -bool ODEJoint::IsLimitJointMaxSpeed1() const -{ - return mIsLimitJointMaxSpeed1; -} - -bool ODEJoint::IsLimitJointMaxSpeed2() const -{ - return mIsLimitJointMaxSpeed2; -} - -float ODEJoint::GetParameter(int parameter) const -{ - return 0.0; -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -33,56 +33,50 @@ public: ODEJoint(); - virtual void DestroyJoint(); - virtual void Attach(boost::shared_ptr<RigidBody> body1, - boost::shared_ptr<RigidBody> body2); - void Attach(const std::string& path1, const std::string& path2); - int GetType() const; - boost::shared_ptr<RigidBody> GetBody(EBodyIndex idx); - void EnableFeedback(bool enable); - bool FeedbackEnabled() const; - salt::Vector3f GetFeedbackForce(EBodyIndex idx) const; - salt::Vector3f GetFeedbackTorque(EBodyIndex idx) const; - void SetFudgeFactor(EAxisIndex idx, float fudge_factor); - float GetFudgeFactor(EAxisIndex idx) const; - void SetBounce(EAxisIndex idx, float bounce); - float GetBounce(EAxisIndex idx) const; - void SetLowStopDeg(EAxisIndex idx, float deg); - float GetLowStopDeg(EAxisIndex idx) const; - void SetHighStopDeg(EAxisIndex idx, float deg); - float GetHighStopDeg(EAxisIndex idx) const; - void SetLowStopPos(EAxisIndex idx, float deg); - float GetLowStopPos(EAxisIndex idx) const; - void SetHighStopPos(EAxisIndex idx, float deg); - float GetHighStopPos(EAxisIndex idx) const; - void SetCFM(EAxisIndex idx, float cfm); - float GetCFM(EAxisIndex idx) const; - void SetStopCFM(EAxisIndex idx, float cfm); - float GetStopCFM(EAxisIndex idx) const; - void SetStopERP(EAxisIndex idx, float erp); - float GetStopERP(EAxisIndex idx) const; - void SetSuspensionERP(EAxisIndex idx, float erp); - float GetSuspensionERP(EAxisIndex idx) const; - void SetSuspensionCFM(EAxisIndex idx, float cfm); - float GetSuspensionCFM(EAxisIndex idx) const; - void SetLinearMotorVelocity(EAxisIndex idx, float vel); - float GetLinearMotorVelocity(EAxisIndex idx) const; - void SetAngularMotorVelocity(EAxisIndex idx, float deg); - float GetAngularMotorVelocity(EAxisIndex idx) const; - void SetMaxMotorForce(EAxisIndex idx, float f); - float GetMaxMotorForce(EAxisIndex idx) const; - virtual void SetParameter(int parameter, float value){}; - virtual float GetParameter(int parameter) const; - virtual void SetJointMaxSpeed1(float rad); - virtual void SetJointMaxSpeed2(float rad); - virtual float GetJointMaxSpeed1() const; - virtual float GetJointMaxSpeed2() const; - bool IsLimitJointMaxSpeed1() const; - bool IsLimitJointMaxSpeed2() const; - void OnLink(); + virtual void DestroyJoint(long jointID); + virtual void Attach(long bodyID1, long bodiID2, long jointID); + int GetType(long jointID) const; + long GetBodyID(int idx, long jointID); + void EnableFeedback(bool enable, long jointID); + bool FeedbackEnabled(long jointID) const; + salt::Vector3f GetFeedbackForce(int idx) const; + salt::Vector3f GetFeedbackTorque(int idx) const; + void SetFudgeFactor(int idx, float fudge_factor, long jointID); + float GetFudgeFactor(int idx, long jointID) const; + void SetBounce(int idx, float bounce, long jointID); + float GetBounce(int idx, long jointID) const; + void SetLowStopDeg(int idx, float deg, long jointID); + float GetLowStopDeg(int idx, long jointID) const; + void SetHighStopDeg(int idx, float deg, long jointID); + float GetHighStopDeg(int idx, long jointID) const; + void SetLowStopPos(int idx, float deg, long jointID); + float GetLowStopPos(int idx, long jointID) const; + void SetHighStopPos(int idx, float deg, long jointID); + float GetHighStopPos(int idx, long jointID) const; + void SetCFM(int idx, float cfm, long jointID); + float GetCFM(int idx, long jointID) const; + void SetStopCFM(int idx, float cfm, long jointID); + float GetStopCFM(int idx, long jointID) const; + void SetStopERP(int idx, float erp, long jointID); + float GetStopERP(int idx, long jointID) const; + void SetSuspensionERP(int idx, float erp, long jointID); + float GetSuspensionERP(int idx, long jointID) const; + void SetSuspensionCFM(int idx, float cfm, long jointID); + float GetSuspensionCFM(int idx, long jointID) const; + void SetLinearMotorVelocity(int idx, float vel, long jointID); + float GetLinearMotorVelocity(int idx, long jointID) const; + void SetAngularMotorVelocity(int idx, float deg, long jointID); + float GetAngularMotorVelocity(int idx, long jointID) const; + void SetMaxMotorForce(int idx, float f, long jointID); + float GetMaxMotorForce(int idx, long jointID) const; + virtual void SetParameter(int parameter, float value, long jointID); + virtual float GetParameter(int parameter, long jointID) const; + void OnLink(long jointID, Joint* joint); protected: - dJointID mODEJoint; + //It is encouraged to not store any member variables in the implementation. + //This can cause major problems. However, here, I found no way to avoid it. + boost::shared_ptr<dJointFeedback> mFeedback; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -51,15 +51,3 @@ dJointID ODEJoint = (dJointID) jointID; return dJointGetSliderPositionRate(ODEJoint); } - -void ODESliderJoint::SetParameter(int parameter, float value, long jointID) -{ - dJointID ODEJoint = (dJointID) jointID; - dJointSetSliderParam(ODEJoint, parameter, value); -} - -float ODESliderJoint::GetParameter(int parameter, long jointID) const -{ - dJointID ODEJoint = (dJointID) jointID; - return dJointGetSliderParam(ODEJoint, parameter); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odesliderjoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -38,8 +38,6 @@ float GetPosition(long jointID); float GetPositionRate(long jointID); void SetSliderAxis(salt::Vector3f& up, long jointID); - void SetParameter(int parameter, float value, long jointID); - float GetParameter(int parameter, long jointID) const; }; } //namespace oxygen Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.cpp 2010-01-08 07:35:25 UTC (rev 138) @@ -110,15 +110,3 @@ dJointID ODEJoint = (dJointID) jointID; return gRadToDeg(dJointGetUniversalAngle2Rate(ODEJoint)); } - -void ODEUniversalJoint::SetParameter(int parameter, float value, long jointID) -{ - dJointID ODEJoint = (dJointID) jointID; - dJointSetUniversalParam(ODEJoint, parameter, value); -} - -float ODEUniversalJoint::GetParameter(int parameter, long jointID) const -{ - dJointID ODEJoint = (dJointID) jointID; - return dJointGetUniversalParam(ODEJoint, parameter); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h 2010-01-06 07:25:00 UTC (rev 137) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeuniversaljoint.h 2010-01-08 07:35:25 UTC (rev 138) @@ -46,8 +46,6 @@ float GetAngle2(long jointID) const; float GetAngleRate1(long jointID) const; float GetAngleRat... [truncated message content] |
From: <a-...@us...> - 2010-01-28 07:14:04
|
Revision: 152 http://simspark.svn.sourceforge.net/simspark/?rev=152&view=rev Author: a-held Date: 2010-01-28 07:13:43 +0000 (Thu, 28 Jan 2010) Log Message: ----------- Created a factory for implementation objects that also uses the bridge pattern. Instead of each physics object having its own implementation object, all objects of the same type get a reference to the same implementation object. This saves some memory and (I think) makes good use of the processor cache; there was a noteable increase on the average FPS after the implementation (before: 23.3 to 23.8, after: 24.1 to 24.8). Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-28 07:13:43 UTC (rev 152) @@ -15,6 +15,7 @@ oxygen.h oxygen_defines.h physicsserver/genericphysicsobjects.h + physicsserver/impfactory.h physicsserver/physicsobject.h physicsserver/body.h physicsserver/rigidbody.h @@ -75,6 +76,7 @@ physicsserver/int/generic6dofjointint.h physicsserver/int/hingejointint.h physicsserver/int/hinge2jointint.h + physicsserver/int/impfactoryint.h physicsserver/int/jointint.h physicsserver/int/physicsobjectint.h physicsserver/int/physicsserverint.h @@ -111,6 +113,7 @@ physicsserver/ode/odegeneric6dofjoint.h physicsserver/ode/odehingejoint.h physicsserver/ode/odehinge2joint.h + physicsserver/ode/odeimpfactory.h physicsserver/ode/odejoint.h physicsserver/ode/odephysicsobject.h physicsserver/ode/odephysicsserver.h @@ -190,6 +193,7 @@ oxygen.cpp physicsserver/physicsobject.cpp physicsserver/physicsobject_c.cpp + physicsserver/impfactory.cpp physicsserver/body.cpp physicsserver/body_c.cpp physicsserver/rigidbody.cpp @@ -285,6 +289,7 @@ physicsserver/ode/odegeneric6dofjoint.cpp physicsserver/ode/odehingejoint.cpp physicsserver/ode/odehinge2joint.cpp + physicsserver/ode/odeimpfactory.cpp physicsserver/ode/odejoint.cpp physicsserver/ode/odephysicsobject.cpp physicsserver/ode/odephysicsserver.cpp Modified: branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/angularmotor.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,7 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/angularmotor.h> -#include <oxygen/physicsserver/ode/odeangularmotor.h> +#include <oxygen/physicsserver/int/angularmotorint.h> +#include <oxygen/physicsserver/int/jointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +29,7 @@ AngularMotor::AngularMotor() : Joint() { - mAngularMotorImp = boost::shared_ptr<ODEAngularMotor>(new ODEAngularMotor()); + mAngularMotorImp = ImpFactory::GetInstance()->GetAngularMotorImp(); } AngularMotor::~AngularMotor() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/balljoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -17,8 +17,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <oxygen/physicsserver/ode/odeballjoint.h> +#include <oxygen/physicsserver/int/balljointint.h> +#include <oxygen/physicsserver/int/jointint.h> #include <oxygen/physicsserver/balljoint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +29,7 @@ BallJoint::BallJoint() : Generic6DOFJoint() { - mBallJointImp = boost::shared_ptr<ODEBallJoint>(new ODEBallJoint()); + mBallJointImp = ImpFactory::GetInstance()->GetBallJointImp(); } BallJoint::~BallJoint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,14 +20,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/body.h> -#include <oxygen/physicsserver/ode/odebody.h> +#include <oxygen/physicsserver/int/bodyint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; Body::Body() : PhysicsObject(), mBodyID(0), mMassTransformed(false), mMassTrans(0,0,0) { - mBodyImp = boost::shared_ptr<ODEBody>(new ODEBody()); + mBodyImp = ImpFactory::GetInstance()->GetBodyImp(); } Body::~Body(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -21,14 +21,15 @@ */ #include <oxygen/physicsserver/boxcollider.h> -#include <oxygen/physicsserver/ode/odeboxcollider.h> +#include <oxygen/physicsserver/int/boxcolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; using namespace salt; BoxCollider::BoxCollider() : ConvexCollider() { - mBoxColliderImp = boost::shared_ptr<ODEBoxCollider>(new ODEBoxCollider()); + mBoxColliderImp = ImpFactory::GetInstance()->GetBoxColliderImp(); } void BoxCollider::SetBoxLengths(const Vector3f& extents) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,14 +20,15 @@ */ #include <oxygen/physicsserver/capsulecollider.h> -#include <oxygen/physicsserver/ode/odecapsulecollider.h> +#include <oxygen/physicsserver/int/capsulecolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; using namespace salt; CapsuleCollider::CapsuleCollider() : ConvexCollider() { - mCapsuleColliderImp = boost::shared_ptr<ODECapsuleCollider>(new ODECapsuleCollider()); + mCapsuleColliderImp = ImpFactory::GetInstance()->GetCapsuleColliderImp(); } void CapsuleCollider::SetParams(float radius, float length) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,7 +20,8 @@ */ #include <oxygen/physicsserver/genericphysicsobjects.h> #include <oxygen/physicsserver/collider.h> -#include <oxygen/physicsserver/ode/odecollider.h> +#include <oxygen/physicsserver/int/colliderint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/collisionhandler.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/staticphysicsmethods.h> @@ -37,7 +38,7 @@ Collider::Collider() : PhysicsObject(), mGeomID(0) { - mColliderImp = boost::shared_ptr<ODECollider>(new ODECollider()); + mColliderImp = ImpFactory::GetInstance()->GetColliderImp(); } Collider::~Collider() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/compoundcollider.h> -#include <oxygen/physicsserver/ode/odecompoundcollider.h> +#include <oxygen/physicsserver/int/compoundcolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; CompoundCollider::CompoundCollider() : Collider(){ - mCompoundColliderImp = boost::shared_ptr<ODECompoundCollider>(new ODECompoundCollider()); + mCompoundColliderImp = ImpFactory::GetInstance()->GetCompoundColliderImp(); } CompoundCollider::~CompoundCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/concavecollider.h> -#include <oxygen/physicsserver/ode/odeconcavecollider.h> +#include <oxygen/physicsserver/int/concavecolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; ConcaveCollider::ConcaveCollider() : Collider(){ - mConcaveColliderImp = boost::shared_ptr<ODEConcaveCollider>(new ODEConcaveCollider()); + mConcaveColliderImp = ImpFactory::GetInstance()->GetConcaveColliderImp(); } ConcaveCollider::~ConcaveCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/conecollider.h> -#include <oxygen/physicsserver/ode/odeconecollider.h> +#include <oxygen/physicsserver/int/conecolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; ConeCollider::ConeCollider() : ConvexCollider(){ - mConeColliderImp = boost::shared_ptr<ODEConeCollider>(new ODEConeCollider()); + mConeColliderImp = ImpFactory::GetInstance()->GetConeColliderImp(); } ConeCollider::~ConeCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -21,12 +21,13 @@ */ #include <oxygen/physicsserver/conetwistjoint.h> -#include <oxygen/physicsserver/ode/odeconetwistjoint.h> +#include <oxygen/physicsserver/int/conetwistjointint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; ConeTwistJoint::ConeTwistJoint() : Generic6DOFJoint(){ - mConeTwistJointImp = boost::shared_ptr<ODEConeTwistJoint>(new ODEConeTwistJoint()); + mConeTwistJointImp = ImpFactory::GetInstance()->GetConeTwistJointImp(); } ConeTwistJoint::~ConeTwistJoint(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,7 +20,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/contactjointhandler.h> -#include <oxygen/physicsserver/ode/odecontactjointhandler.h> +#include <oxygen/physicsserver/int/contactjointhandlerint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/collider.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> @@ -31,7 +32,7 @@ ContactJointHandler::ContactJointHandler() : CollisionHandler() { - mContactJointHandlerImp = boost::shared_ptr<ODEContactJointHandler>(new ODEContactJointHandler()); + mContactJointHandlerImp = ImpFactory::GetInstance()->GetContactJointHandlerImp(); mSurfaceParameter = mContactJointHandlerImp->Initialize(); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/convexcollider.h> -#include <oxygen/physicsserver/ode/odeconvexcollider.h> +#include <oxygen/physicsserver/int/convexcolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; ConvexCollider::ConvexCollider() : Collider(){ - mConvexColliderImp = boost::shared_ptr<ODEConvexCollider>(new ODEConvexCollider()); + mConvexColliderImp = ImpFactory::GetInstance()->GetConvexColliderImp(); } ConvexCollider::~ConvexCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/cylindercollider.h> -#include <oxygen/physicsserver/ode/odecylindercollider.h> +#include <oxygen/physicsserver/int/cylindercolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; CylinderCollider::CylinderCollider() : ConvexCollider(){ - mCylinderColliderImp = boost::shared_ptr<ODECylinderCollider>(new ODECylinderCollider()); + mCylinderColliderImp = ImpFactory::GetInstance()->GetCylinderColliderImp(); } CylinderCollider::~CylinderCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/dynamicbody.h> -#include <oxygen/physicsserver/ode/odedynamicbody.h> +#include <oxygen/physicsserver/int/dynamicbodyint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; DynamicBody::DynamicBody() : Body(){ - mDynamicBodyImp = boost::shared_ptr<ODEDynamicBody>(new ODEDynamicBody()); + mDynamicBodyImp = ImpFactory::GetInstance()->GetDynamicBodyImp(); } DynamicBody::~DynamicBody(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/emptycollider.h> -#include <oxygen/physicsserver/ode/odeemptycollider.h> +#include <oxygen/physicsserver/int/emptycolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; EmptyCollider::EmptyCollider() : Collider(){ - mEmptyColliderImp = boost::shared_ptr<ODEEmptyCollider>(new ODEEmptyCollider()); + mEmptyColliderImp = ImpFactory::GetInstance()->GetEmptyColliderImp(); } EmptyCollider::~EmptyCollider(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,14 +18,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/fixedjoint.h> -#include <oxygen/physicsserver/ode/odefixedjoint.h> +#include <oxygen/physicsserver/int/fixedjointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; FixedJoint::FixedJoint() : Generic6DOFJoint() { - mFixedJointImp = boost::shared_ptr<ODEFixedJoint>(new ODEFixedJoint()); + mFixedJointImp = ImpFactory::GetInstance()->GetFixedJointImp(); } FixedJoint::~FixedJoint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -21,12 +21,13 @@ */ #include <oxygen/physicsserver/generic6dofjoint.h> -#include <oxygen/physicsserver/ode/odegeneric6dofjoint.h> +#include <oxygen/physicsserver/int/generic6dofjointint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; Generic6DOFJoint::Generic6DOFJoint() : Joint(){ - mGeneric6DOFJointImp = boost::shared_ptr<ODEGeneric6DOFJoint>(new ODEGeneric6DOFJoint()); + mGeneric6DOFJointImp = ImpFactory::GetInstance()->GetGeneric6DOFJointImp(); } Generic6DOFJoint::~Generic6DOFJoint(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,7 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hinge2joint.h> -#include <oxygen/physicsserver/ode/odehinge2joint.h> +#include <oxygen/physicsserver/int/hinge2jointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +28,7 @@ Hinge2Joint::Hinge2Joint() : Generic6DOFJoint() { - mHinge2JointImp = boost::shared_ptr<ODEHinge2Joint>(new ODEHinge2Joint()); + mHinge2JointImp = ImpFactory::GetInstance()->GetHinge2JointImp(); } Hinge2Joint::~Hinge2Joint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,7 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hingejoint.h> -#include <oxygen/physicsserver/ode/odehingejoint.h> +#include <oxygen/physicsserver/int/hingejointint.h> +#include <oxygen/physicsserver/int/jointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +29,7 @@ HingeJoint::HingeJoint() : Generic6DOFJoint() { - mHingeJointImp = boost::shared_ptr<ODEHingeJoint>(new ODEHingeJoint()); + mHingeJointImp = ImpFactory::GetInstance()->GetHingeJointImp(); } HingeJoint::~HingeJoint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-01-28 07:13:43 UTC (rev 152) @@ -25,6 +25,7 @@ #include <oxygen/physicsserver/ode/odewrapper.h> #include <oxygen/oxygen_defines.h> +#include <salt/matrix.h> #include <set> #include <string> Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,7 +20,8 @@ #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/rigidbody.h> #include <oxygen/physicsserver/staticphysicsmethods.h> -#include <oxygen/physicsserver/ode/odejoint.h> +#include <oxygen/physicsserver/impfactory.h> +#include <oxygen/physicsserver/int/jointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -33,7 +34,7 @@ mJointMaxSpeed1(0), mJointMaxSpeed2(0), mIsLimitJointMaxSpeed1(false), mIsLimitJointMaxSpeed2(false) { - mJointImp = boost::shared_ptr<ODEJoint>(new ODEJoint()); + mJointImp = ImpFactory::GetInstance()->GetJointImp(); } Joint::~Joint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -24,7 +24,8 @@ #include <oxygen/physicsserver/physicsobject.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> -#include <oxygen/physicsserver/ode/odephysicsobject.h> +#include <oxygen/physicsserver/int/physicsobjectint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> @@ -33,7 +34,7 @@ PhysicsObject::PhysicsObject() : BaseNode() { - mPhysicsObjectImp = shared_ptr<ODEPhysicsObject>(new ODEPhysicsObject()); + mPhysicsObjectImp = ImpFactory::GetInstance()->GetPhysicsObjectImp(); } PhysicsObject::~PhysicsObject() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,11 +20,12 @@ */ #include <oxygen/physicsserver/physicsserver.h> -#include <oxygen/physicsserver/ode/odephysicsserver.h> +#include <oxygen/physicsserver/int/physicsserverint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; PhysicsServer::PhysicsServer() : Leaf() { - mPhysicsServerImp = boost::shared_ptr<ODEPhysicsServer>(new ODEPhysicsServer()); + mPhysicsServerImp = ImpFactory::GetInstance()->GetPhysicsServerImp(); } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,7 +20,8 @@ */ #include <oxygen/physicsserver/planecollider.h> -#include <oxygen/physicsserver/ode/odeplanecollider.h> +#include <oxygen/physicsserver/int/planecolliderint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -28,7 +29,7 @@ PlaneCollider::PlaneCollider() : Collider() { - mPlaneColliderImp = boost::shared_ptr<ODEPlaneCollider>(new ODEPlaneCollider()); + mPlaneColliderImp = ImpFactory::GetInstance()->GetPlaneColliderImp(); } void PlaneCollider::SetParams(float a, float b, float c, float d) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -19,14 +19,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <oxygen/physicsserver/ode/oderaycollider.h> +#include <oxygen/physicsserver/int/raycolliderint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/raycollider.h> using namespace oxygen; RayCollider::RayCollider() : Collider() { - mRayColliderImp = boost::shared_ptr<ODERayCollider>(new ODERayCollider()); + mRayColliderImp = ImpFactory::GetInstance()->GetRayColliderImp(); } void RayCollider::SetParams(salt::Vector3f pos, Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -21,7 +21,8 @@ #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/staticphysicsmethods.h> #include <oxygen/physicsserver/world.h> -#include <oxygen/physicsserver/ode/oderigidbody.h> +#include <oxygen/physicsserver/int/rigidbodyint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/sceneserver/scene.h> #include <oxygen/sceneserver/transform.h> #include <zeitgeist/logserver/logserver.h> @@ -33,7 +34,7 @@ RigidBody::RigidBody() : Body() { - mRigidBodyImp = boost::shared_ptr<ODERigidBody>(new ODERigidBody()); + mRigidBodyImp = ImpFactory::GetInstance()->GetRigidBodyImp(); } RigidBody::~RigidBody() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,7 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/sliderjoint.h> -#include <oxygen/physicsserver/ode/odesliderjoint.h> +#include <oxygen/physicsserver/int/sliderjointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +28,7 @@ SliderJoint::SliderJoint() : Generic6DOFJoint() { - mSliderJointImp = boost::shared_ptr<ODESliderJoint>(new ODESliderJoint()); + mSliderJointImp = ImpFactory::GetInstance()->GetSliderJointImp(); } SliderJoint::~SliderJoint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/softbody.h> -#include <oxygen/physicsserver/ode/odesoftbody.h> +#include <oxygen/physicsserver/int/softbodyint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; SoftBody::SoftBody() : Body(){ - mSoftBodyImp = boost::shared_ptr<ODESoftBody>(new ODESoftBody()); + mSoftBodyImp = ImpFactory::GetInstance()->GetSoftBodyImp(); } SoftBody::~SoftBody(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,7 +20,8 @@ */ #include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/ode/odespace.h> +#include <oxygen/physicsserver/int/spaceint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/collider.h> #include <oxygen/physicsserver/world.h> #include <oxygen/sceneserver/scene.h> @@ -33,7 +34,7 @@ Space::Space() : PhysicsObject(), mSpaceID(0) { - mSpaceImp = shared_ptr<ODESpace>(new ODESpace()); + mSpaceImp = ImpFactory::GetInstance()->GetSpaceImp(); } Space::~Space() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,14 +20,15 @@ */ #include <oxygen/physicsserver/spherecollider.h> -#include <oxygen/physicsserver/ode/odespherecollider.h> +#include <oxygen/physicsserver/int/spherecolliderint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; using namespace salt; SphereCollider::SphereCollider() : ConvexCollider() { - mSphereColliderImp = boost::shared_ptr<ODESphereCollider>(new ODESphereCollider()); + mSphereColliderImp = ImpFactory::GetInstance()->GetSphereColliderImp(); } void SphereCollider::SetRadius(float r) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,12 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/staticbody.h> -#include <oxygen/physicsserver/ode/odestaticbody.h> +#include <oxygen/physicsserver/int/staticbodyint.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; StaticBody::StaticBody() : Body(){ - mStaticBodyImp = boost::shared_ptr<ODEStaticBody>(new ODEStaticBody()); + mStaticBodyImp = ImpFactory::GetInstance()->GetStaticBodyImp(); } StaticBody::~StaticBody(){ Modified: branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -20,15 +20,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <oxygen/physicsserver/ode/odetransformcollider.h> +#include <oxygen/physicsserver/int/transformcolliderint.h> #include <oxygen/physicsserver/transformcollider.h> +#include <oxygen/physicsserver/impfactory.h> using namespace oxygen; using namespace salt; TransformCollider::TransformCollider() : Collider() { - mTransformColliderImp = boost::shared_ptr<ODETransformCollider>(new ODETransformCollider()); + mTransformColliderImp = ImpFactory::GetInstance()->GetTransformColliderImp(); } bool TransformCollider::ConstructInternal() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -18,7 +18,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/universaljoint.h> -#include <oxygen/physicsserver/ode/odeuniversaljoint.h> +#include <oxygen/physicsserver/int/universaljointint.h> +#include <oxygen/physicsserver/int/jointint.h> +#include <oxygen/physicsserver/impfactory.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -27,7 +29,7 @@ UniversalJoint::UniversalJoint() : Generic6DOFJoint() { - mUniversalJointImp = boost::shared_ptr<ODEUniversalJoint>(new ODEUniversalJoint()); + mUniversalJointImp = ImpFactory::GetInstance()->GetUniversalJointImp(); } UniversalJoint::~UniversalJoint() Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2010-01-26 11:23:42 UTC (rev 151) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2010-01-28 07:13:43 UTC (rev 152) @@ -19,7 +19,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <oxygen/physicsserver/ode/odeworld.h> +#include <oxygen/physicsserver/int/worldint.h> +#include <oxygen/physicsserver/impfactory.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> #include <oxygen/sceneserver/scene.h> @@ -30,7 +31,7 @@ World::World() : PhysicsObject() { - mWorldImp = shared_ptr<ODEWorld>(new ODEWorld()); + mWorldImp = ImpFactory::GetInstance()->GetWorldImp(); } World::~World() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-01-28 07:24:57
|
Revision: 154 http://simspark.svn.sourceforge.net/simspark/?rev=154&view=rev Author: a-held Date: 2010-01-28 07:24:51 +0000 (Thu, 28 Jan 2010) Log Message: ----------- move staticphysicsmethods_ode.cpp in physicsserver/ode folder Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods_ode.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-28 07:17:35 UTC (rev 153) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-01-28 07:24:51 UTC (rev 154) @@ -93,7 +93,7 @@ physicsserver/int/worldint.h #ode-specific files - physicsserver/staticphysicsmethods_ode.cpp + physicsserver/ode/staticphysicsmethods_ode.cpp physicsserver/ode/odeangularmotor.h physicsserver/ode/odeballjoint.h physicsserver/ode/odebody.h Added: branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp 2010-01-28 07:24:51 UTC (rev 154) @@ -0,0 +1,56 @@ +/* -*- 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: body.cpp 106 2009-11-19 10:10:50Z a-held $ + + 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/staticphysicsmethods.h> +#include <oxygen/physicsserver/collider.h> +#include <oxygen/physicsserver/joint.h> +#include <oxygen/physicsserver/rigidbody.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/ode/odewrapper.h> + +using namespace oxygen; +using namespace boost; + +Collider* StaticPhysicsMethods::GetColliderPointer(long geomID){ + dGeomID ODEGeom = (dGeomID) geomID; + return static_cast<Collider*>(dGeomGetData(ODEGeom)); +} + +Joint* StaticPhysicsMethods::GetJoint(long jointID){ + dJointID ODEJoint = (dJointID) jointID; + return static_cast<Joint*>(dJointGetData(ODEJoint)); +} + +RigidBody* StaticPhysicsMethods::GetBodyPointer(long bodyID){ + dBodyID ODEBody = (dBodyID) bodyID; + return static_cast<RigidBody*>(dBodyGetData(ODEBody)); +} + +bool StaticPhysicsMethods::AreConnected(long bodyID1, long bodyID2){ + dBodyID ODEBody1 = (dBodyID) bodyID1; + dBodyID ODEBody2 = (dBodyID) bodyID2; + return dAreConnected(ODEBody1, ODEBody2) == 1; +} + +bool StaticPhysicsMethods::AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type){ + dBodyID ODEBody1 = (dBodyID) bodyID1; + dBodyID ODEBody2 = (dBodyID) bodyID2; + return dAreConnectedExcluding(ODEBody1, ODEBody2, joint_type) == 1; +} Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods_ode.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods_ode.cpp 2010-01-28 07:17:35 UTC (rev 153) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods_ode.cpp 2010-01-28 07:24:51 UTC (rev 154) @@ -1,56 +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: body.cpp 106 2009-11-19 10:10:50Z a-held $ - - 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/staticphysicsmethods.h> -#include <oxygen/physicsserver/collider.h> -#include <oxygen/physicsserver/joint.h> -#include <oxygen/physicsserver/rigidbody.h> -#include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/ode/odewrapper.h> - -using namespace oxygen; -using namespace boost; - -Collider* StaticPhysicsMethods::GetColliderPointer(long geomID){ - dGeomID ODEGeom = (dGeomID) geomID; - return static_cast<Collider*>(dGeomGetData(ODEGeom)); -} - -Joint* StaticPhysicsMethods::GetJoint(long jointID){ - dJointID ODEJoint = (dJointID) jointID; - return static_cast<Joint*>(dJointGetData(ODEJoint)); -} - -RigidBody* StaticPhysicsMethods::GetBodyPointer(long bodyID){ - dBodyID ODEBody = (dBodyID) bodyID; - return static_cast<RigidBody*>(dBodyGetData(ODEBody)); -} - -bool StaticPhysicsMethods::AreConnected(long bodyID1, long bodyID2){ - dBodyID ODEBody1 = (dBodyID) bodyID1; - dBodyID ODEBody2 = (dBodyID) bodyID2; - return dAreConnected(ODEBody1, ODEBody2) == 1; -} - -bool StaticPhysicsMethods::AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type){ - dBodyID ODEBody1 = (dBodyID) bodyID1; - dBodyID ODEBody2 = (dBodyID) bodyID2; - return dAreConnectedExcluding(ODEBody1, ODEBody2, joint_type) == 1; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-02 08:17:22
|
Revision: 156 http://simspark.svn.sourceforge.net/simspark/?rev=156&view=rev Author: a-held Date: 2010-02-02 08:17:15 +0000 (Tue, 02 Feb 2010) Log Message: ----------- got rid of staticphysicsmethods class Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods.h Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-02 08:17:15 UTC (rev 156) @@ -40,7 +40,6 @@ physicsserver/recorderhandler.h physicsserver/space.h physicsserver/spherecollider.h - physicsserver/staticphysicsmethods.h physicsserver/transformcollider.h physicsserver/world.h physicsserver/dragcontroller.h @@ -93,7 +92,6 @@ physicsserver/int/worldint.h #ode-specific files - physicsserver/ode/staticphysicsmethods_ode.cpp physicsserver/ode/odeangularmotor.h physicsserver/ode/odeballjoint.h physicsserver/ode/odebody.h Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -167,7 +167,7 @@ } Collider* collPtr = - StaticPhysicsMethods::GetColliderPointer(geomID); + mColliderImp->GetColliderPointer(geomID); if (collPtr == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-02 08:17:15 UTC (rev 156) @@ -37,6 +37,10 @@ { public: + /** Gets the pointer to the Collider object that manages the geom + specified by geomID. + */ + virtual Collider* GetColliderPointer(long geomID) = 0; virtual void SetPosition(const salt::Vector3f& globalPos, long geomID) = 0; virtual void SetLocalPosition(const salt::Vector3f& pos, long geomID) = 0; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-02 08:17:15 UTC (rev 156) @@ -38,7 +38,22 @@ class OXYGEN_API JointInt { public: + + /** Gets the pointer to the Joint object that manages the joint + specified by jointID. + */ + virtual Joint* GetJoint(long jointID) = 0; + /** Checks if two bodies, specified by bodyID1 and bodyID2, are + connected by a joint. + */ + virtual bool AreConnected(long bodyID1, long bodyID2) = 0; + + /** Checks if two bodies, specified by bodyID1 and bodyID2, are + connected by a joint that is not of the type specified by joint_type. + */ + virtual bool AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type) = 0; + virtual void DestroyJoint(long jointID, boost::shared_ptr<GenericJointFeedback> feedback) = 0; virtual void Attach(long bodyID1, long bodiID2, long jointID) = 0; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h 2010-02-02 08:17:15 UTC (rev 156) @@ -34,6 +34,8 @@ { public: + virtual RigidBody* GetBodyPointer(long bodyID) = 0; + virtual void Enable(long bodyID) = 0; virtual void Disable(long bodyID) = 0; virtual bool IsEnabled(long bodyID) const = 0; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -60,7 +60,7 @@ return shared_ptr<Joint>(); } - Joint* jointPtr = StaticPhysicsMethods::GetJoint(jointID); + Joint* jointPtr = mJointImp->GetJoint(jointID); if (jointPtr == 0) { @@ -184,7 +184,7 @@ return false; } - const bool connected = StaticPhysicsMethods::AreConnected(body1->GetBodyID(), body2->GetBodyID()); + const bool connected = mJointImp->AreConnected(body1->GetBodyID(), body2->GetBodyID()); return connected; } @@ -201,10 +201,9 @@ return false; } - const bool connected = - StaticPhysicsMethods::AreConnectedExcluding(body1->GetBodyID(), - body2->GetBodyID(), - joint_type); + const bool connected = mJointImp->AreConnectedExcluding(body1->GetBodyID(), + body2->GetBodyID(), + joint_type); return connected; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -44,6 +44,11 @@ { } +Collider* ODECollider::GetColliderPointer(long geomID){ + dGeomID ODEGeom = (dGeomID) geomID; + return static_cast<Collider*>(dGeomGetData(ODEGeom)); +} + void ODECollider::SetRotation(const Matrix& rot, long geomID) { dGeomID ODEGeom = (dGeomID) geomID; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.h 2010-02-02 08:17:15 UTC (rev 156) @@ -37,6 +37,11 @@ ODECollider(); virtual ~ODECollider(); + /** Gets the pointer to the Collider object that manages the geom + specified by geomID. + */ + Collider* GetColliderPointer(long geomID); + void SetPosition(const salt::Vector3f& globalPos, long geomID); void SetLocalPosition(const salt::Vector3f& pos, long GeomID); salt::Vector3f GetPosition(long geomID) const; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -31,6 +31,23 @@ { } +Joint* ODEJoint::GetJoint(long jointID){ + dJointID ODEJoint = (dJointID) jointID; + return static_cast<Joint*>(dJointGetData(ODEJoint)); +} + +bool ODEJoint::AreConnected(long bodyID1, long bodyID2){ + dBodyID ODEBody1 = (dBodyID) bodyID1; + dBodyID ODEBody2 = (dBodyID) bodyID2; + return dAreConnected(ODEBody1, ODEBody2) == 1; +} + +bool ODEJoint::AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type){ + dBodyID ODEBody1 = (dBodyID) bodyID1; + dBodyID ODEBody2 = (dBodyID) bodyID2; + return dAreConnectedExcluding(ODEBody1, ODEBody2, joint_type) == 1; +} + void ODEJoint::OnLink(long jointID, Joint* joint) { dJointID ODEJoint = (dJointID) jointID; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/odejoint.h 2010-02-02 08:17:15 UTC (rev 156) @@ -33,6 +33,10 @@ { public: ODEJoint(); + + Joint* GetJoint(long jointID); + bool AreConnected(long bodyID1, long bodyID2); + bool AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type); virtual void DestroyJoint(long jointID, boost::shared_ptr<GenericJointFeedback> feedback); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -36,6 +36,11 @@ ODERigidBody::ODERigidBody() : Body(){ } +RigidBody* ODERigidBody::GetBodyPointer(long bodyID){ + dBodyID ODEBody = (dBodyID) bodyID; + return static_cast<RigidBody*>(dBodyGetData(ODEBody)); +} + void ODERigidBody::Enable(long bodyID) { dBodyID ODEBody = (dBodyID) bodyID; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.h 2010-02-02 08:17:15 UTC (rev 156) @@ -35,6 +35,8 @@ public: ODERigidBody(); + RigidBody* GetBodyPointer(long bodyID); + void Enable(long bodyID); void Disable(long bodyID); bool IsEnabled(long bodyID) const; Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/ode/staticphysicsmethods_ode.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -1,56 +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: body.cpp 106 2009-11-19 10:10:50Z a-held $ - - 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/staticphysicsmethods.h> -#include <oxygen/physicsserver/collider.h> -#include <oxygen/physicsserver/joint.h> -#include <oxygen/physicsserver/rigidbody.h> -#include <oxygen/physicsserver/space.h> -#include <oxygen/physicsserver/ode/odewrapper.h> - -using namespace oxygen; -using namespace boost; - -Collider* StaticPhysicsMethods::GetColliderPointer(long geomID){ - dGeomID ODEGeom = (dGeomID) geomID; - return static_cast<Collider*>(dGeomGetData(ODEGeom)); -} - -Joint* StaticPhysicsMethods::GetJoint(long jointID){ - dJointID ODEJoint = (dJointID) jointID; - return static_cast<Joint*>(dJointGetData(ODEJoint)); -} - -RigidBody* StaticPhysicsMethods::GetBodyPointer(long bodyID){ - dBodyID ODEBody = (dBodyID) bodyID; - return static_cast<RigidBody*>(dBodyGetData(ODEBody)); -} - -bool StaticPhysicsMethods::AreConnected(long bodyID1, long bodyID2){ - dBodyID ODEBody1 = (dBodyID) bodyID1; - dBodyID ODEBody2 = (dBodyID) bodyID2; - return dAreConnected(ODEBody1, ODEBody2) == 1; -} - -bool StaticPhysicsMethods::AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type){ - dBodyID ODEBody1 = (dBodyID) bodyID1; - dBodyID ODEBody2 = (dBodyID) bodyID2; - return dAreConnectedExcluding(ODEBody1, ODEBody2, joint_type) == 1; -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-02-02 08:17:15 UTC (rev 156) @@ -327,7 +327,7 @@ return shared_ptr<RigidBody>(); } - RigidBody* bodyPtr = StaticPhysicsMethods::GetBodyPointer(bodyID); + RigidBody* bodyPtr = mRigidBodyImp->GetBodyPointer(bodyID); if (bodyPtr == 0) { Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods.h 2010-02-01 05:08:06 UTC (rev 155) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticphysicsmethods.h 2010-02-02 08:17:15 UTC (rev 156) @@ -1,71 +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: joint.h 107 2009-11-25 06:09:10Z a-held $ - - 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_STATICPHYSICSMETHODS_H -#define OXYGEN_STATICPHYSICSMETHODS_H - -#include <oxygen/oxygen_defines.h> - -namespace oxygen -{ -class Collider; -class Joint; -class RigidBody; -/** StaticPhysicsMethods is a workaround class. It defines static - engine-specific methods which are called from within other - static methods in engine-unspecific classes. - - The StaticPhysicsMethods class should be implemented once for each - supported engine. The preprocessor must decide which file to use. -*/ - -class OXYGEN_API StaticPhysicsMethods{ - -public: - /** Gets the pointer to the Collider object that manages the geom - specified by geomID. - */ - static Collider* GetColliderPointer(long geomID); - - /** Gets the pointer to the Joint object that manages the joint - specified by jointID. - */ - static Joint* GetJoint(long jointID); - - /** Gets the pointer to the RigidBody object that manages the rigid body - specified by bodyID. - */ - static RigidBody* GetBodyPointer(long bodyID); - - /** Checks if two bodies, specified by bodyID1 and bodyID2, are - connected by a joint. - */ - static bool AreConnected(long bodyID1, long bodyID2); - - /** Checks if two bodies, specified by bodyID1 and bodyID2, are - connected by a joint that is not of the type specified by joint_type. - */ - static bool AreConnectedExcluding(long bodyID1, long bodyID2, int joint_type); -}; - -} //namespace oxygen - -#endif //OXYGEN_GENERICPHYSICSOBJECTS_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-04 07:56:19
|
Revision: 158 http://simspark.svn.sourceforge.net/simspark/?rev=158&view=rev Author: a-held Date: 2010-02-04 07:56:12 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Let SceneServer communicate with PhysicsServer instead of using physics classes directly Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-02-03 09:27:51 UTC (rev 157) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-02-04 07:56:12 UTC (rev 158) @@ -22,12 +22,59 @@ #include <oxygen/physicsserver/physicsserver.h> #include <oxygen/physicsserver/int/physicsserverint.h> #include <oxygen/physicsserver/impfactory.h> +#include <oxygen/physicsserver/world.h> +#include <oxygen/physicsserver/space.h> +#include <oxygen/sceneserver/scene.h> +#include <iostream> using namespace oxygen; +using namespace boost; -boost::shared_ptr<PhysicsServerInt> PhysicsServer::mPhysicsServerImp; +shared_ptr<PhysicsServerInt> PhysicsServer::mPhysicsServerImp; +shared_ptr<PhysicsServer> PhysicsServer::mInstance; PhysicsServer::PhysicsServer() : Leaf() { mPhysicsServerImp = ImpFactory::GetInstance()->GetPhysicsServerImp(); } + +shared_ptr<PhysicsServer> PhysicsServer::GetInstance(){ + if (mInstance.get() == 0) + mInstance = shared_ptr<PhysicsServer>(new PhysicsServer()); + return mInstance; +} + +void PhysicsServer::ResetCache(){ + mActiveSpace.reset(); + mActiveWorld.reset(); +} + +void PhysicsServer::UpdateCache(shared_ptr<Scene> activeScene){ + if (mActiveSpace.get() == 0) + { + // cache the space reference + mActiveSpace = shared_dynamic_cast<Space> + (activeScene->GetChildOfClass("Space")); + } + + if (mActiveWorld.get() == 0) + { + // cache the world reference + mActiveWorld = shared_dynamic_cast<World> + (activeScene->GetChildOfClass("World")); + } +} + +void PhysicsServer::DoCollisions(){ + if (mActiveSpace.get() != 0) + { + mActiveSpace->Collide(); + } +} + +void PhysicsServer::StepSimulation(float deltaTime){ + if (mActiveWorld.get() != 0) + { + mActiveWorld->Step(deltaTime); + } +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2010-02-03 09:27:51 UTC (rev 157) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2010-02-04 07:56:12 UTC (rev 158) @@ -25,10 +25,14 @@ #include <zeitgeist/class.h> #include <zeitgeist/leaf.h> #include <oxygen/oxygen_defines.h> +#include <boost/shared_ptr.hpp> namespace oxygen { class PhysicsServerInt; +class Scene; +class World; +class Space; class OXYGEN_API PhysicsServer : public zeitgeist::Leaf { @@ -39,8 +43,31 @@ PhysicsServer(); virtual ~PhysicsServer(){}; + /** Returns the instance of the PhysicsServer. */ + static boost::shared_ptr<PhysicsServer> GetInstance(); + + /** Resets the active space and active world */ + void ResetCache(); + + /** Updates the active world and active space */ + void UpdateCache(boost::shared_ptr<Scene> acticeScene); + + /** Collides all objects in the active space */ + void DoCollisions(); + + /** Advance the simulation by \param deltatime */ + void StepSimulation(float deltaTime); + private: + static boost::shared_ptr<PhysicsServer> mInstance; + static boost::shared_ptr<PhysicsServerInt> mPhysicsServerImp; + + /** cached reference to the Space node below the active scene */ + boost::shared_ptr<Space> mActiveSpace; + + /** cached reference to the World node below the active scene */ + boost::shared_ptr<World> mActiveWorld; }; DECLARE_CLASS(PhysicsServer); Modified: branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp 2010-02-03 09:27:51 UTC (rev 157) +++ branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp 2010-02-04 07:56:12 UTC (rev 158) @@ -30,8 +30,7 @@ #include "scene.h" #include "sceneimporter.h" #include "scenedict.h" -#include <oxygen/physicsserver/world.h> -#include <oxygen/physicsserver/space.h> +#include <oxygen/physicsserver/physicsserver.h> using namespace boost; using namespace oxygen; @@ -70,8 +69,7 @@ void SceneServer::ResetCache() { - mActiveSpace.reset(); - mActiveWorld.reset(); + PhysicsServer::GetInstance()->ResetCache(); } void SceneServer::UpdateCache() @@ -81,20 +79,15 @@ ResetCache(); return; } - - if (mActiveSpace.get() == 0) - { - // cache the space reference - mActiveSpace = shared_dynamic_cast<Space> - (mActiveScene->GetChildOfClass("Space")); - } - - if (mActiveWorld.get() == 0) - { - // cache the world reference - mActiveWorld = shared_dynamic_cast<World> - (mActiveScene->GetChildOfClass("World")); - } + + /*shared_ptr<PhysicsServer> phServer = shared_static_cast<PhysicsServer> + (GetChildOfClass("oxygen/PhysicsServer")); + + if (phServer.get() == 0){ + GetLog()->Error() << "(SceneServer) No PhysicsServer found!"; + }*/ + + PhysicsServer::GetInstance()->UpdateCache(mActiveScene.get()); } void SceneServer::OnUnlink() @@ -161,16 +154,10 @@ mActiveScene->PrePhysicsUpdate(deltaTime); // determine collisions - if (mActiveSpace.get() != 0) - { - mActiveSpace->Collide(); - } + PhysicsServer::GetInstance()->DoCollisions(); // do physics - if (mActiveWorld.get() != 0) - { - mActiveWorld->Step(deltaTime); - } + PhysicsServer::GetInstance()->StepSimulation(deltaTime); mActiveScene->PostPhysicsUpdate(); mActiveScene->UpdateHierarchy(); @@ -196,16 +183,10 @@ { boost::recursive_mutex::scoped_lock lock(mMutex); // determine collisions - if (mActiveSpace.get() != 0) - { - mActiveSpace->Collide(); - } + PhysicsServer::GetInstance()->DoCollisions(); // do physics - if (mActiveWorld.get() != 0) - { - mActiveWorld->Step(deltaTime); - } + PhysicsServer::GetInstance()->StepSimulation(deltaTime); } void SceneServer::PostPhysicsUpdate() Modified: branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h 2010-02-03 09:27:51 UTC (rev 157) +++ branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h 2010-02-04 07:56:12 UTC (rev 158) @@ -47,8 +47,6 @@ #endif class Scene; -class Space; -class World; class BaseNode; class Transform; @@ -128,12 +126,6 @@ /** the current active scene */ CachedPath<Scene> mActiveScene; - /** cached reference to the Space node below the active scene */ - boost::shared_ptr<Space> mActiveSpace; - - /** cached reference to the World node below the active scene */ - boost::shared_ptr<World> mActiveWorld; - /** modified transform nodes are labeled with this value, the value is incremented each cycle to avoid a resetting */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-10 03:50:47
|
Revision: 162 http://simspark.svn.sourceforge.net/simspark/?rev=162&view=rev Author: a-held Date: 2010-02-10 03:50:40 +0000 (Wed, 10 Feb 2010) Log Message: ----------- Fetch PhysicsServer from SceneGraph instead of using a GetInstance method Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-02-09 05:23:09 UTC (rev 161) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.cpp 2010-02-10 03:50:40 UTC (rev 162) @@ -22,34 +22,32 @@ #include <oxygen/physicsserver/physicsserver.h> #include <oxygen/physicsserver/int/physicsserverint.h> #include <oxygen/physicsserver/impfactory.h> +#include <oxygen/physicsserver/rigidbody.h> #include <oxygen/physicsserver/world.h> #include <oxygen/physicsserver/space.h> #include <oxygen/sceneserver/scene.h> +#include <oxygen/sceneserver/transform.h> +#include <zeitgeist/logserver/logserver.h> #include <iostream> using namespace oxygen; using namespace boost; +using namespace std; shared_ptr<PhysicsServerInt> PhysicsServer::mPhysicsServerImp; -shared_ptr<PhysicsServer> PhysicsServer::mInstance; PhysicsServer::PhysicsServer() : Leaf() { mPhysicsServerImp = ImpFactory::GetInstance()->GetPhysicsServerImp(); } -shared_ptr<PhysicsServer> PhysicsServer::GetInstance(){ - if (mInstance.get() == 0) - mInstance = shared_ptr<PhysicsServer>(new PhysicsServer()); - return mInstance; -} - void PhysicsServer::ResetCache(){ mActiveSpace.reset(); mActiveWorld.reset(); } -void PhysicsServer::UpdateCache(shared_ptr<Scene> activeScene){ +void PhysicsServer::UpdateCache(shared_ptr<Scene> activeScene) +{ if (mActiveSpace.get() == 0) { // cache the space reference @@ -72,9 +70,24 @@ } } -void PhysicsServer::StepSimulation(float deltaTime){ +void PhysicsServer::StepSimulation(float deltaTime) +{ if (mActiveWorld.get() != 0) { mActiveWorld->Step(deltaTime); } } + +void PhysicsServer::SetUpBox(shared_ptr<RigidBody> body, string name) +{ + if (body.get() != 0) + { + body->SetName(name); + } +} + +void PhysicsServer::ConfirmExistence() +{ + GetLog()->Normal() << + "(PhysicsServer) I print, therefore I am\n"; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2010-02-09 05:23:09 UTC (rev 161) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsserver.h 2010-02-10 03:50:40 UTC (rev 162) @@ -26,11 +26,13 @@ #include <zeitgeist/leaf.h> #include <oxygen/oxygen_defines.h> #include <boost/shared_ptr.hpp> +#include <string> namespace oxygen { class PhysicsServerInt; class Scene; +class RigidBody; class World; class Space; @@ -43,9 +45,6 @@ PhysicsServer(); virtual ~PhysicsServer(){}; - /** Returns the instance of the PhysicsServer. */ - static boost::shared_ptr<PhysicsServer> GetInstance(); - /** Resets the active space and active world */ void ResetCache(); @@ -58,9 +57,13 @@ /** Advance the simulation by \param deltatime */ void StepSimulation(float deltaTime); + /** Creates a new Box and adds it to the SceneGraph */ + void SetUpBox(boost::shared_ptr<RigidBody> body, std::string name); + + /** Used for debugging */ + void ConfirmExistence(); + private: - static boost::shared_ptr<PhysicsServer> mInstance; - static boost::shared_ptr<PhysicsServerInt> mPhysicsServerImp; /** cached reference to the Space node below the active scene */ Modified: branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp 2010-02-09 05:23:09 UTC (rev 161) +++ branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.cpp 2010-02-10 03:50:40 UTC (rev 162) @@ -41,13 +41,34 @@ int SceneServer::mTransformMark = 0; SceneServer::SceneServer() : Node() -{ +{ } SceneServer::~SceneServer() { } +void SceneServer::OnLink() +{ + shared_ptr<CoreContext> context = GetCore()->CreateContext(); + + mPhysicsServer = shared_static_cast<PhysicsServer> + (context->Get("/sys/server/physics")); + + if (mPhysicsServer.get() == 0) + { + GetLog()->Error() << + "(SceneServer) ERROR: PhysicsServer not found at /sys/server/physics\n"; + } + else + { + GetLog()->Normal() << + "(SceneServer) Found PhysicsServer\n"; + + mPhysicsServer->ConfirmExistence(); + } +} + bool SceneServer::CreateScene(const std::string &location) { shared_ptr<CoreContext> context = GetCore()->CreateContext(); @@ -69,7 +90,7 @@ void SceneServer::ResetCache() { - PhysicsServer::GetInstance()->ResetCache(); + mPhysicsServer->ResetCache(); } void SceneServer::UpdateCache() @@ -80,14 +101,7 @@ return; } - /*shared_ptr<PhysicsServer> phServer = shared_static_cast<PhysicsServer> - (GetChildOfClass("oxygen/PhysicsServer")); - - if (phServer.get() == 0){ - GetLog()->Error() << "(SceneServer) No PhysicsServer found!"; - }*/ - - PhysicsServer::GetInstance()->UpdateCache(mActiveScene.get()); + mPhysicsServer->UpdateCache(mActiveScene.get()); } void SceneServer::OnUnlink() @@ -154,10 +168,10 @@ mActiveScene->PrePhysicsUpdate(deltaTime); // determine collisions - PhysicsServer::GetInstance()->DoCollisions(); + mPhysicsServer->DoCollisions(); // do physics - PhysicsServer::GetInstance()->StepSimulation(deltaTime); + mPhysicsServer->StepSimulation(deltaTime); mActiveScene->PostPhysicsUpdate(); mActiveScene->UpdateHierarchy(); @@ -183,10 +197,10 @@ { boost::recursive_mutex::scoped_lock lock(mMutex); // determine collisions - PhysicsServer::GetInstance()->DoCollisions(); + mPhysicsServer->DoCollisions(); // do physics - PhysicsServer::GetInstance()->StepSimulation(deltaTime); + mPhysicsServer->StepSimulation(deltaTime); } void SceneServer::PostPhysicsUpdate() @@ -376,5 +390,3 @@ return true; } - - Modified: branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h =================================================================== --- branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h 2010-02-09 05:23:09 UTC (rev 161) +++ branches/multiphys/spark/lib/oxygen/sceneserver/sceneserver.h 2010-02-10 03:50:40 UTC (rev 162) @@ -49,6 +49,7 @@ class Scene; class BaseNode; class Transform; +class PhysicsServer; /** The scene server manages displayable subtrees within the object hierarchy. Each subtree begins with a Scene node. The scene server knows @@ -107,6 +108,9 @@ /** resets all cached references */ void ResetCache(); + + /** Retrieves the PhysicsServer from the SceneGraph */ + virtual void OnLink(); /** resets all cached references */ virtual void OnUnlink(); @@ -122,6 +126,10 @@ */ void RemoveTransformPaths(boost::shared_ptr<zeitgeist::Leaf> root); + /** Pointer to the instance of the physicsserver */ + //causes crash at runtime if declared + boost::shared_ptr<PhysicsServer> mPhysicsServer; + private: /** the current active scene */ CachedPath<Scene> mActiveScene; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-16 04:21:25
|
Revision: 164 http://simspark.svn.sourceforge.net/simspark/?rev=164&view=rev Author: a-held Date: 2010-02-16 04:21:16 +0000 (Tue, 16 Feb 2010) Log Message: ----------- Created _c.cpp files for all interfaces Added object factories for interfaces into scenegraph Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/oxygen.cpp branches/multiphys/spark/lib/oxygen/oxygen.h Added Paths: ----------- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-15 05:00:21 UTC (rev 163) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-16 04:21:16 UTC (rev 164) @@ -267,6 +267,42 @@ physicsserver/angularmotor.cpp physicsserver/angularmotor_c.cpp + #interfaces + physicsserver/int/angularmotorint_c.cpp + physicsserver/int/balljointint_c.cpp + physicsserver/int/bodyint_c.cpp + physicsserver/int/boxcolliderint_c.cpp + physicsserver/int/capsulecolliderint_c.cpp + physicsserver/int/colliderint_c.cpp + physicsserver/int/compoundcolliderint_c.cpp + physicsserver/int/concavecolliderint_c.cpp + physicsserver/int/conecolliderint_c.cpp + physicsserver/int/conetwistjointint_c.cpp + physicsserver/int/contactjointhandlerint_c.cpp + physicsserver/int/convexcolliderint_c.cpp + physicsserver/int/cylindercolliderint_c.cpp + physicsserver/int/dynamicbodyint_c.cpp + physicsserver/int/emptycolliderint_c.cpp + physicsserver/int/fixedjointint_c.cpp + physicsserver/int/generic6dofjointint_c.cpp + physicsserver/int/hinge2jointint_c.cpp + physicsserver/int/hingejointint_c.cpp + physicsserver/int/jointint_c.cpp + physicsserver/int/physicsobjectint_c.cpp + physicsserver/int/physicsserverint_c.cpp + physicsserver/int/planecolliderint_c.cpp + physicsserver/int/raycolliderint_c.cpp + physicsserver/int/rigidbodyint_c.cpp + physicsserver/int/sliderjointint_c.cpp + physicsserver/int/softbodyint_c.cpp + physicsserver/int/spaceint_c.cpp + physicsserver/int/spherecolliderint_c.cpp + physicsserver/int/staticbodyint_c.cpp + physicsserver/int/transformcolliderint_c.cpp + physicsserver/int/universaljointint_c.cpp + physicsserver/int/worldint_c.cpp + + #ODE-specific files physicsserver/ode/odeangularmotor.cpp physicsserver/ode/odeballjoint.cpp Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2010-02-15 05:00:21 UTC (rev 163) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -66,6 +66,7 @@ zg.GetCore()->RegisterClassObject(new CLASS(World), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Joint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(Generic6DOFJoint), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(AngularMotor), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(BallJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(ConeTwistJoint), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(HingeJoint), "oxygen/"); @@ -93,6 +94,41 @@ zg.GetCore()->RegisterClassObject(new CLASS(CollisionHandler), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(ContactJointHandler), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(RecorderHandler), "oxygen/"); + + // implementations + zg.GetCore()->RegisterClassObject(new CLASS(AngularMotorInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(BallJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(BodyInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(BoxColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(CapsuleColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(CompoundColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConcaveColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConeColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConeTwistJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ContactJointHandlerInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(ConvexColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(CylinderColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(DynamicBodyInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(EmptyColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(FixedJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(Generic6DOFJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(Hinge2JointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(HingeJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(JointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(PhysicsObjectInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(PhysicsServerInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(PlaneColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(RayColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(RigidBodyInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(SliderJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(SoftBodyInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(SpaceInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(SphereColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(StaticBodyInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(TransformColliderInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(UniversalJointInt), "oxygen/"); + zg.GetCore()->RegisterClassObject(new CLASS(WorldInt), "oxygen/"); // agentaspect zg.GetCore()->RegisterClassObject(new CLASS(AgentAspect), "oxygen/"); Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2010-02-15 05:00:21 UTC (rev 163) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2010-02-16 04:21:16 UTC (rev 164) @@ -65,6 +65,7 @@ #include <oxygen/physicsserver/recorderhandler.h> #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/generic6dofjoint.h> +#include <oxygen/physicsserver/angularmotor.h> #include <oxygen/physicsserver/balljoint.h> #include <oxygen/physicsserver/conetwistjoint.h> #include <oxygen/physicsserver/hingejoint.h> @@ -73,6 +74,42 @@ #include <oxygen/physicsserver/universaljoint.h> #include <oxygen/physicsserver/hinge2joint.h> +//implementations +#include <oxygen/physicsserver/int/angularmotorint.h> +#include <oxygen/physicsserver/int/balljointint.h> +#include <oxygen/physicsserver/int/bodyint.h> +#include <oxygen/physicsserver/int/boxcolliderint.h> +#include <oxygen/physicsserver/int/capsulecolliderint.h> +#include <oxygen/physicsserver/int/colliderint.h> +#include <oxygen/physicsserver/int/compoundcolliderint.h> +#include <oxygen/physicsserver/int/concavecolliderint.h> +#include <oxygen/physicsserver/int/conecolliderint.h> +#include <oxygen/physicsserver/int/conetwistjointint.h> +#include <oxygen/physicsserver/int/contactjointhandlerint.h> +#include <oxygen/physicsserver/int/convexcolliderint.h> +#include <oxygen/physicsserver/int/cylindercolliderint.h> +#include <oxygen/physicsserver/int/dynamicbodyint.h> +#include <oxygen/physicsserver/int/emptycolliderint.h> +#include <oxygen/physicsserver/int/fixedjointint.h> +#include <oxygen/physicsserver/int/generic6dofjointint.h> +#include <oxygen/physicsserver/int/hinge2jointint.h> +#include <oxygen/physicsserver/int/hingejointint.h> +#include <oxygen/physicsserver/int/jointint.h> +#include <oxygen/physicsserver/int/physicsobjectint.h> +#include <oxygen/physicsserver/int/physicsserverint.h> +#include <oxygen/physicsserver/int/planecolliderint.h> +#include <oxygen/physicsserver/int/raycolliderint.h> +#include <oxygen/physicsserver/int/rigidbodyint.h> +#include <oxygen/physicsserver/int/sliderjointint.h> +#include <oxygen/physicsserver/int/softbodyint.h> +#include <oxygen/physicsserver/int/spaceint.h> +#include <oxygen/physicsserver/int/spherecolliderint.h> +#include <oxygen/physicsserver/int/staticbodyint.h> +#include <oxygen/physicsserver/int/transformcolliderint.h> +#include <oxygen/physicsserver/int/universaljointint.h> +#include <oxygen/physicsserver/int/worldint.h> + + #include <oxygen/sceneserver/basenode.h> #include <oxygen/sceneserver/camera.h> #include <oxygen/sceneserver/fpscontroller.h> Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/angularmotorint.h> + +using namespace oxygen; + +void CLASS(AngularMotorInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/balljointint.h> + +using namespace oxygen; + +void CLASS(BallJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/bodyint.h> + +using namespace oxygen; + +void CLASS(BodyInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/boxcolliderint.h> + +using namespace oxygen; + +void CLASS(BoxColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/capsulecolliderint.h> + +using namespace oxygen; + +void CLASS(CapsuleColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/colliderint.h> + +using namespace oxygen; + +void CLASS(ColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/compoundcolliderint.h> + +using namespace oxygen; + +void CLASS(CompoundColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/concavecolliderint.h> + +using namespace oxygen; + +void CLASS(ConcaveColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/conecolliderint.h> + +using namespace oxygen; + +void CLASS(ConeColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/conetwistjointint.h> + +using namespace oxygen; + +void CLASS(ConeTwistJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/contactjointhandlerint.h> + +using namespace oxygen; + +void CLASS(ContactJointHandlerInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/convexcolliderint.h> + +using namespace oxygen; + +void CLASS(ConvexColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/cylindercolliderint.h> + +using namespace oxygen; + +void CLASS(CylinderColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/dynamicbodyint.h> + +using namespace oxygen; + +void CLASS(DynamicBodyInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/emptycolliderint.h> + +using namespace oxygen; + +void CLASS(EmptyColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/fixedjointint.h> + +using namespace oxygen; + +void CLASS(FixedJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/generic6dofjointint.h> + +using namespace oxygen; + +void CLASS(Generic6DOFJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/hinge2jointint.h> + +using namespace oxygen; + +void CLASS(Hinge2JointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/hingejointint.h> + +using namespace oxygen; + +void CLASS(HingeJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/jointint.h> + +using namespace oxygen; + +void CLASS(JointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/physicsobjectint.h> + +using namespace oxygen; + +void CLASS(PhysicsObjectInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/physicsserverint.h> + +using namespace oxygen; + +void CLASS(PhysicsServerInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/planecolliderint.h> + +using namespace oxygen; + +void CLASS(PlaneColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/raycolliderint.h> + +using namespace oxygen; + +void CLASS(RayColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/rigidbodyint.h> + +using namespace oxygen; + +void CLASS(RigidBodyInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/sliderjointint.h> + +using namespace oxygen; + +void CLASS(SliderJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/softbodyint.h> + +using namespace oxygen; + +void CLASS(SoftBodyInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/spaceint.h> + +using namespace oxygen; + +void CLASS(SpaceInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/spherecolliderint.h> + +using namespace oxygen; + +void CLASS(SphereColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/staticbodyint.h> + +using namespace oxygen; + +void CLASS(StaticBodyInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/transformcolliderint.h> + +using namespace oxygen; + +void CLASS(TransformColliderInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/universaljointint.h> + +using namespace oxygen; + +void CLASS(UniversalJointInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} Added: branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp (rev 0) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) @@ -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/int/worldint.h> + +using namespace oxygen; + +void CLASS(WorldInt)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/BaseNode); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <a-...@us...> - 2010-02-17 05:05:03
|
Revision: 165 http://simspark.svn.sourceforge.net/simspark/?rev=165&view=rev Author: a-held Date: 2010-02-17 05:04:55 +0000 (Wed, 17 Feb 2010) Log Message: ----------- Undo changes made to physicsserver made in r164 and r163 implemented first and thought later. Sorry :-( Modified Paths: -------------- 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/int/angularmotorint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint.h branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h Removed Paths: ------------- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsserverint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/planecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/raycolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/rigidbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/sliderjointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/softbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/spaceint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/staticbodyint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/transformcolliderint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/universaljointint_c.cpp branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint_c.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-17 05:04:55 UTC (rev 165) @@ -265,44 +265,8 @@ physicsserver/hinge2joint.cpp physicsserver/hinge2joint_c.cpp physicsserver/angularmotor.cpp - physicsserver/angularmotor_c.cpp + physicsserver/angularmotor_c.cpp - #interfaces - physicsserver/int/angularmotorint_c.cpp - physicsserver/int/balljointint_c.cpp - physicsserver/int/bodyint_c.cpp - physicsserver/int/boxcolliderint_c.cpp - physicsserver/int/capsulecolliderint_c.cpp - physicsserver/int/colliderint_c.cpp - physicsserver/int/compoundcolliderint_c.cpp - physicsserver/int/concavecolliderint_c.cpp - physicsserver/int/conecolliderint_c.cpp - physicsserver/int/conetwistjointint_c.cpp - physicsserver/int/contactjointhandlerint_c.cpp - physicsserver/int/convexcolliderint_c.cpp - physicsserver/int/cylindercolliderint_c.cpp - physicsserver/int/dynamicbodyint_c.cpp - physicsserver/int/emptycolliderint_c.cpp - physicsserver/int/fixedjointint_c.cpp - physicsserver/int/generic6dofjointint_c.cpp - physicsserver/int/hinge2jointint_c.cpp - physicsserver/int/hingejointint_c.cpp - physicsserver/int/jointint_c.cpp - physicsserver/int/physicsobjectint_c.cpp - physicsserver/int/physicsserverint_c.cpp - physicsserver/int/planecolliderint_c.cpp - physicsserver/int/raycolliderint_c.cpp - physicsserver/int/rigidbodyint_c.cpp - physicsserver/int/sliderjointint_c.cpp - physicsserver/int/softbodyint_c.cpp - physicsserver/int/spaceint_c.cpp - physicsserver/int/spherecolliderint_c.cpp - physicsserver/int/staticbodyint_c.cpp - physicsserver/int/transformcolliderint_c.cpp - physicsserver/int/universaljointint_c.cpp - physicsserver/int/worldint_c.cpp - - #ODE-specific files physicsserver/ode/odeangularmotor.cpp physicsserver/ode/odeballjoint.cpp Modified: branches/multiphys/spark/lib/oxygen/oxygen.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/oxygen.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -94,41 +94,6 @@ zg.GetCore()->RegisterClassObject(new CLASS(CollisionHandler), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(ContactJointHandler), "oxygen/"); zg.GetCore()->RegisterClassObject(new CLASS(RecorderHandler), "oxygen/"); - - // implementations - zg.GetCore()->RegisterClassObject(new CLASS(AngularMotorInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(BallJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(BodyInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(BoxColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(CapsuleColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(CompoundColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ConcaveColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ConeColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ConeTwistJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ContactJointHandlerInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(ConvexColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(CylinderColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(DynamicBodyInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(EmptyColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(FixedJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(Generic6DOFJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(Hinge2JointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(HingeJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(JointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(PhysicsObjectInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(PhysicsServerInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(PlaneColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(RayColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(RigidBodyInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(SliderJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(SoftBodyInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(SpaceInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(SphereColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(StaticBodyInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(TransformColliderInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(UniversalJointInt), "oxygen/"); - zg.GetCore()->RegisterClassObject(new CLASS(WorldInt), "oxygen/"); // agentaspect zg.GetCore()->RegisterClassObject(new CLASS(AgentAspect), "oxygen/"); Modified: branches/multiphys/spark/lib/oxygen/oxygen.h =================================================================== --- branches/multiphys/spark/lib/oxygen/oxygen.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/oxygen.h 2010-02-17 05:04:55 UTC (rev 165) @@ -74,42 +74,6 @@ #include <oxygen/physicsserver/universaljoint.h> #include <oxygen/physicsserver/hinge2joint.h> -//implementations -#include <oxygen/physicsserver/int/angularmotorint.h> -#include <oxygen/physicsserver/int/balljointint.h> -#include <oxygen/physicsserver/int/bodyint.h> -#include <oxygen/physicsserver/int/boxcolliderint.h> -#include <oxygen/physicsserver/int/capsulecolliderint.h> -#include <oxygen/physicsserver/int/colliderint.h> -#include <oxygen/physicsserver/int/compoundcolliderint.h> -#include <oxygen/physicsserver/int/concavecolliderint.h> -#include <oxygen/physicsserver/int/conecolliderint.h> -#include <oxygen/physicsserver/int/conetwistjointint.h> -#include <oxygen/physicsserver/int/contactjointhandlerint.h> -#include <oxygen/physicsserver/int/convexcolliderint.h> -#include <oxygen/physicsserver/int/cylindercolliderint.h> -#include <oxygen/physicsserver/int/dynamicbodyint.h> -#include <oxygen/physicsserver/int/emptycolliderint.h> -#include <oxygen/physicsserver/int/fixedjointint.h> -#include <oxygen/physicsserver/int/generic6dofjointint.h> -#include <oxygen/physicsserver/int/hinge2jointint.h> -#include <oxygen/physicsserver/int/hingejointint.h> -#include <oxygen/physicsserver/int/jointint.h> -#include <oxygen/physicsserver/int/physicsobjectint.h> -#include <oxygen/physicsserver/int/physicsserverint.h> -#include <oxygen/physicsserver/int/planecolliderint.h> -#include <oxygen/physicsserver/int/raycolliderint.h> -#include <oxygen/physicsserver/int/rigidbodyint.h> -#include <oxygen/physicsserver/int/sliderjointint.h> -#include <oxygen/physicsserver/int/softbodyint.h> -#include <oxygen/physicsserver/int/spaceint.h> -#include <oxygen/physicsserver/int/spherecolliderint.h> -#include <oxygen/physicsserver/int/staticbodyint.h> -#include <oxygen/physicsserver/int/transformcolliderint.h> -#include <oxygen/physicsserver/int/universaljointint.h> -#include <oxygen/physicsserver/int/worldint.h> - - #include <oxygen/sceneserver/basenode.h> #include <oxygen/sceneserver/camera.h> #include <oxygen/sceneserver/fpscontroller.h> Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -25,7 +25,6 @@ #include <salt/vector.h> #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { @@ -38,7 +37,7 @@ rotation about those axes. */ -class OXYGEN_API AngularMotorInt : public BaseNode +class OXYGEN_API AngularMotorInt { public: /** Creates a new angular motor within the physics world specified @@ -107,8 +106,6 @@ virtual float GetAxisAngleRate(int idx, long jointID) = 0; }; -DECLARE_ABSTRACTCLASS(AngularMotorInt); - } //namespace oxygen #endif //OXYGEN_ANGULARMOTORINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/angularmotorint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/angularmotorint.h> - -using namespace oxygen; - -void CLASS(AngularMotorInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -25,14 +25,13 @@ #include <salt/vector.h> #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { class RigidBody; class Joint; -class OXYGEN_API BallJointInt : public BaseNode +class OXYGEN_API BallJointInt { public: @@ -60,8 +59,6 @@ virtual long CreateBallJoint(long worldID) = 0; }; -DECLARE_ABSTRACTCLASS(BallJointInt); - } //namespace oxygen #endif //OXYGEN_BALLJOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/balljointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/balljointint.h> - -using namespace oxygen; - -void CLASS(BallJointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_BODYINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API BodyInt : public BaseNode +class OXYGEN_API BodyInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(BodyInt); - } //namespace oxygen #endif //OXYGEN_BODYINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/bodyint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/bodyint.h> - -using namespace oxygen; - -void CLASS(BodyInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -25,12 +25,11 @@ #include <salt/vector.h> #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API BoxColliderInt : public BaseNode +class OXYGEN_API BoxColliderInt { public: @@ -51,8 +50,6 @@ virtual long CreateBox() = 0; }; -DECLARE_ABSTRACTCLASS(BoxColliderInt); - } //namespace oxygen #endif //OXYGEN_BOXCOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/boxcolliderint.h> - -using namespace oxygen; - -void CLASS(BoxColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,13 +24,12 @@ #define OXYGEN_CAPSULECOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> #include <salt/vector.h> namespace oxygen { -class OXYGEN_API CapsuleColliderInt : public BaseNode +class OXYGEN_API CapsuleColliderInt { public: @@ -67,8 +66,6 @@ virtual long CreateCapsule() = 0; }; -DECLARE_ABSTRACTCLASS(CapsuleColliderInt); - } //namespace oxygen #endif //OXYGEN_CAPSULECOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/capsulecolliderint.h> - -using namespace oxygen; - -void CLASS(CapsuleColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,7 +24,6 @@ #define OXYGEN_COLLIDERINT_H #include <oxygen/physicsserver/ode/odewrapper.h> -#include <oxygen/sceneserver/basenode.h> #include <oxygen/oxygen_defines.h> #include <salt/matrix.h> #include <set> @@ -34,7 +33,7 @@ { class Collider; -class OXYGEN_API ColliderInt : public BaseNode +class OXYGEN_API ColliderInt { public: @@ -96,8 +95,6 @@ virtual void RemoveFromSpace(long geomID, long spaceID) = 0; }; -DECLARE_ABSTRACTCLASS(ColliderInt); - } //namespace oxygen #endif //OXYGEN_COLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/colliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/colliderint.h> - -using namespace oxygen; - -void CLASS(ColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_COMPOUNDCOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API CompoundColliderInt : public BaseNode +class OXYGEN_API CompoundColliderInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(CompoundColliderInt); - } //namespace oxygen #endif //OXYGEN_COMPOUNDCOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/compoundcolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/compoundcolliderint.h> - -using namespace oxygen; - -void CLASS(CompoundColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_CONCAVECOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API ConcaveColliderInt : public BaseNode +class OXYGEN_API ConcaveColliderInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(ConcaveColliderInt); - } //namespace oxygen #endif //OXYGEN_CONCAVECOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/concavecolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/concavecolliderint.h> - -using namespace oxygen; - -void CLASS(ConcaveColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_CONECOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API ConeColliderInt : public BaseNode +class OXYGEN_API ConeColliderInt { /** This class is currently not implemented. */ }; -DECLARE_CLASS(ConeColliderInt); - } //namespace oxygen #endif //OXYGEN_CONECOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/conecolliderint.h> - -using namespace oxygen; - -void CLASS(ConeColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_CONETWISTJOINTINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API ConeTwistJointInt : public BaseNode +class OXYGEN_API ConeTwistJointInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(ConeTwistJointInt); - } //namespace oxygen #endif //OXYGEN_CONETWISTJOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/conetwistjointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/conetwistjointint.h> - -using namespace oxygen; - -void CLASS(ConeTwistJointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,14 +24,14 @@ #define OXYGEN_CONTACTJOINTHANDLERINT_H #include <oxygen/physicsserver/ode/odewrapper.h> -#include <oxygen/sceneserver/basenode.h> + #include <oxygen/oxygen_defines.h> #include <oxygen/physicsserver/genericphysicsobjects.h> namespace oxygen { -class OXYGEN_API ContactJointHandlerInt : public BaseNode +class OXYGEN_API ContactJointHandlerInt { public: /** Returns a pointer to a SurfaceParameter class whose values were initialized @@ -135,8 +135,6 @@ virtual float MixValues(const float v1, const float v2, const int n) const = 0; }; -DECLARE_ABSTRACTCLASS(ContactJointHandlerInt); - } //namespace oxygen #endif //OXYGEN_CONTACTJOINTHANDLERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/contactjointhandlerint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/contactjointhandlerint.h> - -using namespace oxygen; - -void CLASS(ContactJointHandlerInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_CONVEXCOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API ConvexColliderInt : public BaseNode +class OXYGEN_API ConvexColliderInt { /** This class is currently not implemented. */ }; -DECLARE_CLASS(ConvexColliderInt); - } //namespace oxygen #endif //OXYGEN_CONVEXCOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/convexcolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/convexcolliderint.h> - -using namespace oxygen; - -void CLASS(ConvexColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_CYLINDERCOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API CylinderColliderInt : public BaseNode +class OXYGEN_API CylinderColliderInt { /** This class is currently not implemented. */ }; -DECLARE_CLASS(CylinderColliderInt); - } //namespace oxygen #endif //OXYGEN_CYLINDERCOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/cylindercolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/cylindercolliderint.h> - -using namespace oxygen; - -void CLASS(CylinderColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_DYNAMICBODYINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API DynamicBodyInt : public BaseNode +class OXYGEN_API DynamicBodyInt { /** This class is currently not implemented. */ }; -DECLARE_CLASS(DynamicBodyInt); - } //namespace oxygen #endif //OXYGEN_DYNAMICBODYINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/dynamicbodyint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/dynamicbodyint.h> - -using namespace oxygen; - -void CLASS(DynamicBodyInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_EMPTYCOLLIDERINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API EmptyColliderInt : public BaseNode +class OXYGEN_API EmptyColliderInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(EmptyColliderInt); - } //namespace oxygen #endif //OXYGEN_EMPTYCOLLIDERINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/emptycolliderint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/emptycolliderint.h> - -using namespace oxygen; - -void CLASS(EmptyColliderInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -21,12 +21,10 @@ #define OXYGEN_FIXEDJOINTINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen{ -class OXYGEN_API FixedJointInt : public BaseNode -{ +class OXYGEN_API FixedJointInt{ public: /** Creates a fixed joint within the physics world specified @@ -40,8 +38,6 @@ virtual void SetFixed(long jointID) = 0; }; -DECLARE_ABSTRACTCLASS(FixedJointInt); - } //namespace oxygen #endif //OXYGEN_FIXEDJOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/fixedjointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/fixedjointint.h> - -using namespace oxygen; - -void CLASS(FixedJointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -24,18 +24,15 @@ #define OXYGEN_GENERIC6DOFJOINTINT_H #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API Generic6DOFJointInt : public BaseNode +class OXYGEN_API Generic6DOFJointInt { /** This class is currently not implemented. */ }; -DECLARE_ABSTRACTCLASS(Generic6DOFJointInt); - } //namespace oxygen #endif //OXYGEN_GENERIC6DOFJOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/generic6dofjointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/generic6dofjointint.h> - -using namespace oxygen; - -void CLASS(Generic6DOFJointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -21,13 +21,11 @@ #define OXYGEN_HINGE2JOINTINT_H #include <salt/vector.h> -#include <oxygen/sceneserver/basenode.h> #include <oxygen/oxygen_defines.h> namespace oxygen{ -class OXYGEN_API Hinge2JointInt : public BaseNode -{ +class OXYGEN_API Hinge2JointInt{ public: /** Creates a hinge2joint within the physics world specified @@ -69,8 +67,6 @@ virtual float GetAngleRate2(long jointID) = 0; }; -DECLARE_ABSTRACTCLASS(Hinge2JointInt); - } //namespace oxygen #endif //OXYGEN_HINGE2JOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hinge2jointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/hinge2jointint.h> - -using namespace oxygen; - -void CLASS(Hinge2JointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -22,12 +22,10 @@ #include <salt/vector.h> #include <oxygen/oxygen_defines.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen{ -class OXYGEN_API HingeJointInt : public BaseNode -{ +class OXYGEN_API HingeJointInt{ public: /** Creates a new hingejoint within the physics world specified @@ -71,8 +69,6 @@ virtual float GetAngleRate(long jointID) const = 0; }; -DECLARE_ABSTRACTCLASS(HingeJointInt); - } //namespace oxygen #endif //OXYGEN_HINGEJOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/hingejointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/hingejointint.h> - -using namespace oxygen; - -void CLASS(HingeJointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -25,7 +25,6 @@ #include <oxygen/physicsserver/genericphysicsobjects.h> #include <oxygen/physicsserver/ode/odewrapper.h> -#include <oxygen/sceneserver/basenode.h> #include <boost/smart_ptr/shared_ptr.hpp> #include <salt/vector.h> #include <oxygen/oxygen_defines.h> @@ -36,9 +35,8 @@ class RigidBody; class Joint; -class OXYGEN_API JointInt : public BaseNode +class OXYGEN_API JointInt { - public: /** Returns a pointer to the Joint object that manages the joint specified by \param jointID. @@ -245,8 +243,6 @@ virtual void OnLink(long jointID, Joint* joint) = 0; }; -DECLARE_ABSTRACTCLASS(JointInt); - } //namespace oxygen #endif //OXYGEN_JOINTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/jointint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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/int/jointint.h> - -using namespace oxygen; - -void CLASS(JointInt)::DefineClass() -{ - DEFINE_BASECLASS(oxygen/BaseNode); -} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h 2010-02-17 05:04:55 UTC (rev 165) @@ -27,12 +27,11 @@ #include <salt/matrix.h> #include <oxygen/oxygen_defines.h> #include <oxygen/physicsserver/genericphysicsobjects.h> -#include <oxygen/sceneserver/basenode.h> namespace oxygen { -class OXYGEN_API PhysicsObjectInt : public BaseNode +class OXYGEN_API PhysicsObjectInt { public: @@ -45,8 +44,6 @@ virtual void ConvertRotationMatrix(const GenericPhysicsMatrix* matrix, salt::Matrix& rot) const = 0; }; -DECLARE_ABSTRACTCLASS(PhysicsObjectInt); - } //namespace oxygen #endif //OXYGEN_PHYSICSOBJECTINT_H Deleted: branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp 2010-02-16 04:21:16 UTC (rev 164) +++ branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint_c.cpp 2010-02-17 05:04:55 UTC (rev 165) @@ -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 ... [truncated message content] |
From: <a-...@us...> - 2010-02-23 09:13:44
|
Revision: 168 http://simspark.svn.sourceforge.net/simspark/?rev=168&view=rev Author: a-held Date: 2010-02-23 09:13:36 +0000 (Tue, 23 Feb 2010) Log Message: ----------- Completely separated odeimps as a plugin Modified Paths: -------------- branches/multiphys/spark/lib/oxygen/CMakeLists.txt branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt =================================================================== --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2010-02-23 09:13:36 UTC (rev 168) @@ -302,7 +302,7 @@ add_library(oxygen ${oxygen_LIB_SRCS} ${oxygen_LIB_HDRS}) target_link_libraries(oxygen rcssnet3D ${Boost_LIBRARIES} - ${ODE_LIBRARY} ${oxygen_require_libs} odeimps) + ${ODE_LIBRARY} ${oxygen_require_libs}) set_target_properties(oxygen PROPERTIES VERSION ${OXYGEN_VERSION} SOVERSION ${OXYGEN_SO_VERSION} DEBUG_POSTFIX _debug) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/body.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -42,6 +42,8 @@ void Body::OnLink() { + PhysicsObject::OnLink(); + if (mBodyImp.get() == 0) mBodyImp = shared_dynamic_cast<BodyInt> (GetCore()->New("BodyImp")); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,25 +20,21 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <../plugin/odeimps/odeboxcollider.h> #include <oxygen/physicsserver/boxcollider.h> #include <oxygen/physicsserver/int/boxcolliderint.h> +#include <iostream> using namespace oxygen; using namespace salt; +using namespace boost; boost::shared_ptr<BoxColliderInt> BoxCollider::mBoxColliderImp; BoxCollider::BoxCollider() : ConvexCollider() { - mBoxColliderImp = boost::shared_ptr<BoxColliderImp>(new BoxColliderImp()); -} + +} -void BoxCollider::OnLink() -{ - Collider::OnLink(); -} - void BoxCollider::SetBoxLengths(const Vector3f& extents) { mBoxColliderImp->SetBoxLengths(extents, mGeomID); @@ -46,6 +42,17 @@ bool BoxCollider::ConstructInternal() { + if (mBoxColliderImp.get() == 0) + mBoxColliderImp = shared_dynamic_cast<BoxColliderInt> + (GetCore()->New("BoxColliderImp")); + + if (mBoxColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(BoxCollider) ERROR: Found no implementation at '/classes/BoxColliderImp'"; + return false; + } + if (! Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/boxcollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -38,7 +38,6 @@ // public: BoxCollider(); - virtual void OnLink(); /** sets the side lengths of the box geom */ void SetBoxLengths(const salt::Vector3f& extents); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,18 @@ */ #include <oxygen/physicsserver/capsulecollider.h> -#include <../plugin/odeimps/odecapsulecollider.h> +#include <oxygen/physicsserver/int/capsulecolliderint.h> +#include <iostream> using namespace oxygen; using namespace salt; +using namespace boost; boost::shared_ptr<CapsuleColliderInt> CapsuleCollider::mCapsuleColliderImp; CapsuleCollider::CapsuleCollider() : ConvexCollider() { - mCapsuleColliderImp = boost::shared_ptr<CapsuleColliderImp>(new CapsuleColliderImp()); + } void CapsuleCollider::SetParams(float radius, float length) @@ -64,6 +66,17 @@ bool CapsuleCollider::ConstructInternal() { + if (mCapsuleColliderImp.get() == 0) + mCapsuleColliderImp = shared_dynamic_cast<CapsuleColliderInt> + (GetCore()->New("CapsuleColliderImp")); + + if (mCapsuleColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(CapsuleCollider) ERROR: Found no implementation at '/classes/CapsuleColliderImp'"; + return false; + } + if (! Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,7 +20,7 @@ */ #include <oxygen/physicsserver/genericphysicsobjects.h> #include <oxygen/physicsserver/collider.h> -#include <../plugin/odeimps/odecollider.h> +#include <oxygen/physicsserver/int/colliderint.h> #include <oxygen/physicsserver/collisionhandler.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/transformcollider.h> @@ -38,7 +38,7 @@ Collider::Collider() : PhysicsObject(), mGeomID(0) { - mColliderImp = boost::shared_ptr<ColliderImp>(new ColliderImp()); + } Collider::~Collider() @@ -48,6 +48,11 @@ void Collider::OnLink() { PhysicsObject::OnLink(); + + if (mColliderImp.get() == 0) + mColliderImp = shared_dynamic_cast<ColliderInt> + (GetCore()->New("ColliderImp")); + if (mGeomID == 0) return; weak_ptr<Node> parent = GetParent(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,40 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/compoundcollider.h> -#include <../plugin/odeimps/odecompoundcollider.h> +#include <oxygen/physicsserver/int/compoundcolliderint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<CompoundColliderInt> CompoundCollider::mCompoundColliderImp; -CompoundCollider::CompoundCollider() : Collider(){ - mCompoundColliderImp = boost::shared_ptr<CompoundColliderImp>(new CompoundColliderImp());; +CompoundCollider::CompoundCollider() : Collider() +{ + } -CompoundCollider::~CompoundCollider(){ +CompoundCollider::~CompoundCollider() +{ } + +bool CompoundCollider::ConstructInternal() +{ + if (mCompoundColliderImp.get() == 0) + mCompoundColliderImp = shared_dynamic_cast<CompoundColliderInt> + (GetCore()->New("CompoundColliderImp")); + + if (mCompoundColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(CompoundCollider) ERROR: No implementation found at '/classes/CompoundColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(CompoundCollider) ERROR: CompoundCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/compoundcollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ CompoundCollider(); virtual ~CompoundCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<CompoundColliderInt> mCompoundColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,41 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/concavecollider.h> -#include <../plugin/odeimps/odeconcavecollider.h> +#include <oxygen/physicsserver/int/concavecolliderint.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<ConcaveColliderInt> ConcaveCollider::mConcaveColliderImp; -ConcaveCollider::ConcaveCollider() : Collider(){ - mConcaveColliderImp = boost::shared_ptr<ConcaveColliderImp>(new ConcaveColliderImp()); +ConcaveCollider::ConcaveCollider() : Collider() +{ + } -ConcaveCollider::~ConcaveCollider(){ +ConcaveCollider::~ConcaveCollider() +{ } + +bool ConcaveCollider::ConstructInternal() +{ + if (mConcaveColliderImp.get() == 0) + mConcaveColliderImp = shared_dynamic_cast<ConcaveColliderInt> + (GetCore()->New("ConcaveColliderImp")); + + if (mConcaveColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(ConcaveCollider) ERROR: No implementation found at '/classes/ConcaveColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(ConcaveCollider) ERROR: ConcaveCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/concavecollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ ConcaveCollider(); virtual ~ConcaveCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<ConcaveColliderInt> mConcaveColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,41 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/conecollider.h> -#include <../plugin/odeimps/odeconecollider.h> +#include <oxygen/physicsserver/int/conecolliderint.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<ConeColliderInt> ConeCollider::mConeColliderImp; -ConeCollider::ConeCollider() : ConvexCollider(){ - mConeColliderImp = boost::shared_ptr<ConeColliderImp>(new ConeColliderImp()); +ConeCollider::ConeCollider() : ConvexCollider() +{ + } -ConeCollider::~ConeCollider(){ +ConeCollider::~ConeCollider() +{ } + +bool ConeCollider::ConstructInternal() +{ + if (mConeColliderImp.get() == 0) + mConeColliderImp = shared_dynamic_cast<ConeColliderInt> + (GetCore()->New("ConeColliderImp")); + + if (mConeColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(ConeCollider) ERROR: No implementation found at '/classes/ConeColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(ConeCollider) ERROR: ConeCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ ConeCollider(); virtual ~ConeCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<ConeColliderInt> mConeColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -21,24 +21,38 @@ */ #include <oxygen/physicsserver/conetwistjoint.h> -#include <../plugin/odeimps/odeconetwistjoint.h> +#include <oxygen/physicsserver/int/conetwistjointint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<ConeTwistJointInt> ConeTwistJoint::mConeTwistJointImp; -ConeTwistJoint::ConeTwistJoint() : Generic6DOFJoint(){ - mConeTwistJointImp = boost::shared_ptr<ConeTwistJointImp>(new ConeTwistJointImp()); +ConeTwistJoint::ConeTwistJoint() : Generic6DOFJoint() +{ + } -ConeTwistJoint::~ConeTwistJoint(){ +ConeTwistJoint::~ConeTwistJoint() +{ } -void ConeTwistJoint::SetParameter(int parameter, float value){ +void ConeTwistJoint::OnLink() +{ + Joint::OnLink(); + if (mConeTwistJointImp.get() == 0) + mConeTwistJointImp = shared_dynamic_cast<ConeTwistJointInt> + (GetCore()->New("ConeTwistJointImp")); } -float ConeTwistJoint::GetParameter(int parameter) const{ +void ConeTwistJoint::SetParameter(int parameter, float value) +{ + +} + +float ConeTwistJoint::GetParameter(int parameter) const +{ return 0.0; } Modified: branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/conetwistjoint.h 2010-02-23 09:13:36 UTC (rev 168) @@ -40,6 +40,8 @@ ConeTwistJoint(); virtual ~ConeTwistJoint(); + virtual void OnLink(); + //overwrite pure virtual methods inherited from Joint //to shut the compiler up void SetParameter(int parameter, float value); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/contactjointhandler.h> -#include <../plugin/odeimps/odecontactjointhandler.h> +#include <oxygen/physicsserver/int/contactjointhandlerint.h> #include <oxygen/physicsserver/collider.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> @@ -33,8 +33,7 @@ ContactJointHandler::ContactJointHandler() : CollisionHandler() { - mContactJointHandlerImp = boost::shared_ptr<ContactJointHandlerImp>(new ContactJointHandlerImp()); - mSurfaceParameter = mContactJointHandlerImp->Initialize(); + } ContactJointHandler::~ContactJointHandler() @@ -42,6 +41,19 @@ delete mSurfaceParameter; } +void ContactJointHandler::OnLink() +{ + CollisionHandler::OnLink(); + + if (mContactJointHandlerImp.get() == 0) + mContactJointHandlerImp = shared_dynamic_cast<ContactJointHandlerInt> + (GetCore()->New("ContactJointHandlerImp")); + + //no failsaving here + //if mCJHImp is a nullpointer at this point it will just crash later, anyway + mSurfaceParameter = mContactJointHandlerImp->Initialize(); +} + void ContactJointHandler::HandleCollision(shared_ptr<Collider> collidee, GenericContact& contact) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/contactjointhandler.h 2010-02-23 09:13:36 UTC (rev 168) @@ -39,6 +39,8 @@ public: ContactJointHandler(); virtual ~ContactJointHandler(); + + virtual void OnLink(); /** Check if the collidee also has a ContactJoint handler registered to it. If yes, create a contact joint between the Modified: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,39 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/convexcollider.h> -#include <../plugin/odeimps/odeconvexcollider.h> +#include <oxygen/physicsserver/int/convexcolliderint.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<ConvexColliderInt> ConvexCollider::mConvexColliderImp; ConvexCollider::ConvexCollider() : Collider(){ - mConvexColliderImp = boost::shared_ptr<ConvexColliderImp>(new ConvexColliderImp()); + } ConvexCollider::~ConvexCollider(){ } + +bool ConvexCollider::ConstructInternal() +{ + if (mConvexColliderImp.get() == 0) + mConvexColliderImp = shared_dynamic_cast<ConvexColliderInt> + (GetCore()->New("ConvexColliderImp")); + + if (mConvexColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(ConvexCollider) ERROR: No implementation found at '/classes/ConvexColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(ConvexCollider) ERROR: ConvexCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/convexcollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -40,6 +40,8 @@ ConvexCollider(); virtual ~ConvexCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<ConvexColliderInt> mConvexColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,39 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/cylindercollider.h> -#include <../plugin/odeimps/odecylindercollider.h> +#include <oxygen/physicsserver/int/cylindercolliderint.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<CylinderColliderInt> CylinderCollider::mCylinderColliderImp; CylinderCollider::CylinderCollider() : ConvexCollider(){ - mCylinderColliderImp = boost::shared_ptr<CylinderColliderImp>(new CylinderColliderImp()); + } CylinderCollider::~CylinderCollider(){ } + +bool CylinderCollider::ConstructInternal() +{ + if (mCylinderColliderImp.get() == 0) + mCylinderColliderImp = shared_dynamic_cast<CylinderColliderInt> + (GetCore()->New("CylinderColliderImp")); + + if (mCylinderColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(CylinderCollider) ERROR: No implementation found at '/classes/CylinderColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(CylinderCollider) ERROR: CylinderCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/cylindercollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -42,6 +42,8 @@ CylinderCollider(); virtual ~CylinderCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<CylinderColliderInt> mCylinderColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,26 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/dynamicbody.h> -#include <../plugin/odeimps/odedynamicbody.h> +#include <oxygen/physicsserver/int/dynamicbodyint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<DynamicBodyInt> DynamicBody::mDynamicBodyImp; DynamicBody::DynamicBody() : Body(){ - mDynamicBodyImp = boost::shared_ptr<DynamicBodyImp>(new DynamicBodyImp()); + } DynamicBody::~DynamicBody(){ } + +void DynamicBody::OnLink() +{ + Body::OnLink(); + + if (mDynamicBodyImp.get() == 0) + mDynamicBodyImp = shared_dynamic_cast<DynamicBodyInt> + (GetCore()->New("DynamicBodyImp")); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/dynamicbody.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ DynamicBody(); virtual ~DynamicBody(); + virtual void OnLink(); + private: static boost::shared_ptr<DynamicBodyInt> mDynamicBodyImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,17 +20,40 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <../plugin/odeimps/odeemptycollider.h> +#include <oxygen/physicsserver/int/emptycolliderint.h> #include <oxygen/physicsserver/emptycollider.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<EmptyColliderInt> EmptyCollider::mEmptyColliderImp; EmptyCollider::EmptyCollider() : Collider(){ - mEmptyColliderImp = boost::shared_ptr<EmptyColliderImp>(new EmptyColliderImp()); + } EmptyCollider::~EmptyCollider(){ } + +bool EmptyCollider::ConstructInternal() +{ + if (mEmptyColliderImp.get() == 0) + mEmptyColliderImp = shared_dynamic_cast<EmptyColliderInt> + (GetCore()->New("EmptyColliderImp")); + + if (mEmptyColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(EmptyCollider) ERROR: No implementation found at '/classes/EmptyColliderImp'"; + return false; + } + + if (!Collider::ConstructInternal()) return false; + + //we can't use the logserver here + std::cerr << "(EmptyCollider) ERROR: EmptyCollider is not implemented yet. Did nothing"; + + return true; +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/emptycollider.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ EmptyCollider(); virtual ~EmptyCollider(); + virtual bool ConstructInternal(); + private: static boost::shared_ptr<EmptyColliderInt> mEmptyColliderImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/fixedjoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -18,16 +18,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/fixedjoint.h> -#include <../plugin/odeimps/odefixedjoint.h> +#include <oxygen/physicsserver/int/fixedjointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<FixedJointInt> FixedJoint::mFixedJointImp; FixedJoint::FixedJoint() : Generic6DOFJoint() { - mFixedJointImp = boost::shared_ptr<FixedJointImp>(new FixedJointImp()); + } FixedJoint::~FixedJoint() @@ -36,6 +37,12 @@ void FixedJoint::OnLink() { + Joint::OnLink(); + + if (mFixedJointImp.get() == 0) + mFixedJointImp = shared_dynamic_cast<FixedJointInt> + (GetCore()->New("FixedJointImp")); + long world = GetWorldID(); if (world == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -21,16 +21,26 @@ */ #include <oxygen/physicsserver/generic6dofjoint.h> -#include <../plugin/odeimps/odegeneric6dofjoint.h> +#include <oxygen/physicsserver/int/generic6dofjointint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<Generic6DOFJointInt> Generic6DOFJoint::mGeneric6DOFJointImp; Generic6DOFJoint::Generic6DOFJoint() : Joint(){ - mGeneric6DOFJointImp = boost::shared_ptr<Generic6DOFJointInt>(new Generic6DOFJointImp()); + } Generic6DOFJoint::~Generic6DOFJoint(){ } + +void Generic6DOFJoint::OnLink() +{ + Joint::OnLink(); + + if (mGeneric6DOFJointImp.get() == 0) + mGeneric6DOFJointImp = shared_dynamic_cast<Generic6DOFJointInt> + (GetCore()->New("Generic6DOFJointImp")); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/generic6dofjoint.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ Generic6DOFJoint(); virtual ~Generic6DOFJoint(); + virtual void OnLink(); + private: static boost::shared_ptr<Generic6DOFJointInt> mGeneric6DOFJointImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hinge2joint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hinge2joint.h> -#include <../plugin/odeimps/odehinge2joint.h> +#include <oxygen/physicsserver/int/hinge2jointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -29,7 +29,7 @@ Hinge2Joint::Hinge2Joint() : Generic6DOFJoint() { - mHinge2JointImp = boost::shared_ptr<Hinge2JointImp>(new Hinge2JointImp()); + } Hinge2Joint::~Hinge2Joint() @@ -38,6 +38,12 @@ void Hinge2Joint::OnLink() { + Joint::OnLink(); + + if (mHinge2JointImp.get() == 0) + mHinge2JointImp = shared_dynamic_cast<Hinge2JointInt> + (GetCore()->New("Hinge2JointImp")); + long world = GetWorldID(); if (world == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/hingejoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/hingejoint.h> -#include <../plugin/odeimps/odehingejoint.h> +#include <oxygen/physicsserver/int/hingejointint.h> #include <oxygen/physicsserver/int/jointint.h> #include <zeitgeist/logserver/logserver.h> @@ -30,7 +30,7 @@ HingeJoint::HingeJoint() : Generic6DOFJoint() { - mHingeJointImp = boost::shared_ptr<HingeJointImp>(new HingeJointImp()); + } HingeJoint::~HingeJoint() @@ -39,6 +39,12 @@ void HingeJoint::OnLink() { + Joint::OnLink(); + + if (mHingeJointImp.get() == 0) + mHingeJointImp = shared_dynamic_cast<HingeJointInt> + (GetCore()->New("HingeJointImp")); + long world = GetWorldID(); if (world == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/joint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -19,7 +19,7 @@ */ #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/rigidbody.h> -#include <../plugin/odeimps/odejoint.h> +#include <oxygen/physicsserver/int/jointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -34,7 +34,7 @@ mJointMaxSpeed1(0), mJointMaxSpeed2(0), mIsLimitJointMaxSpeed1(false), mIsLimitJointMaxSpeed2(false) { - mJointImp = boost::shared_ptr<JointInt>(new JointImp()); + } Joint::~Joint() @@ -43,6 +43,10 @@ void Joint::OnLink() { + if (mJointImp.get() == 0) + mJointImp = shared_dynamic_cast<JointInt> + (GetCore()->New("JointImp")); + if (mJointID == 0) { return; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -24,7 +24,7 @@ #include <oxygen/physicsserver/physicsobject.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> -#include <../plugin/odeimps/odephysicsobject.h> +#include <oxygen/physicsserver/int/physicsobjectint.h> #include <oxygen/sceneserver/scene.h> #include <zeitgeist/logserver/logserver.h> @@ -35,13 +35,20 @@ PhysicsObject::PhysicsObject() : BaseNode() { - mPhysicsObjectImp = boost::shared_ptr<PhysicsObjectInt>(new PhysicsObjectImp()); + } PhysicsObject::~PhysicsObject() { } +void PhysicsObject::OnLink() +{ + if (mPhysicsObjectImp.get() == 0) + mPhysicsObjectImp = shared_dynamic_cast<PhysicsObjectInt> + (GetCore()->New("PhysicsObjectImp")); +} + void PhysicsObject::OnUnlink() { DestroyPhysicsObject(); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h 2010-02-23 09:13:36 UTC (rev 168) @@ -43,6 +43,8 @@ // PhysicsObject(); virtual ~PhysicsObject(); + + virtual void OnLink(); /** This rountine is called, before the hierarchy object is removed from the parent. It can be overridden to support Modified: branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/planecollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,17 +20,19 @@ */ #include <oxygen/physicsserver/planecollider.h> -#include <../plugin/odeimps/odeplanecollider.h> +#include <oxygen/physicsserver/int/planecolliderint.h> #include <zeitgeist/logserver/logserver.h> +#include <iostream> using namespace oxygen; using namespace salt; +using namespace boost; boost::shared_ptr<PlaneColliderInt> PlaneCollider::mPlaneColliderImp; PlaneCollider::PlaneCollider() : Collider() { - mPlaneColliderImp = boost::shared_ptr<PlaneColliderImp>(new PlaneColliderImp()); + } void PlaneCollider::SetParams(float a, float b, float c, float d) @@ -50,6 +52,17 @@ bool PlaneCollider::ConstructInternal() { + if (mPlaneColliderImp.get() == 0) + mPlaneColliderImp = shared_dynamic_cast<PlaneColliderInt> + (GetCore()->New("PlaneColliderImp")); + + if (mPlaneColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(PlaneCollider) ERROR: No implementation found at '/classes/PlaneColliderImp'"; + return false; + } + if (! Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/raycollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -19,16 +19,18 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <../plugin/odeimps/oderaycollider.h> +#include <oxygen/physicsserver/int/raycolliderint.h> #include <oxygen/physicsserver/raycollider.h> +#include <iostream> using namespace oxygen; +using namespace boost; boost::shared_ptr<RayColliderInt> RayCollider::mRayColliderImp; RayCollider::RayCollider() : Collider() { - mRayColliderImp = boost::shared_ptr<RayColliderImp>(new RayColliderImp()); + } void RayCollider::SetParams(salt::Vector3f pos, @@ -39,6 +41,17 @@ bool RayCollider::ConstructInternal() { + if (mRayColliderImp.get() == 0) + mRayColliderImp = shared_dynamic_cast<RayColliderInt> + (GetCore()->New("RayColliderImp")); + + if (mRayColliderImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(RayCollider) ERROR: No implementation found at '/classes/RayColliderImp'"; + return false; + } + if (! Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,10 +20,11 @@ #include <oxygen/physicsserver/rigidbody.h> #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/world.h> -#include <../plugin/odeimps/oderigidbody.h> +#include <oxygen/physicsserver/int/rigidbodyint.h> #include <oxygen/sceneserver/scene.h> #include <oxygen/sceneserver/transform.h> #include <zeitgeist/logserver/logserver.h> +#include <iostream> using namespace boost; using namespace oxygen; @@ -34,7 +35,7 @@ RigidBody::RigidBody() : Body() { - mRigidBodyImp = boost::shared_ptr<RigidBodyImp>(new RigidBodyImp()); + } RigidBody::~RigidBody() @@ -78,6 +79,17 @@ return true; } + if (mRigidBodyImp.get() == 0) + mRigidBodyImp = shared_dynamic_cast<RigidBodyInt> + (GetCore()->New("RigidBodyImp")); + + if (mRigidBodyImp.get() == 0) + { + //we can't use the logserver here + std::cerr << "(RigidBody) ERROR: No implementation found at '/classes/RigidBodyImp'"; + return false; + } + long world = (long) GetWorldID(); if (world == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/sliderjoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/sliderjoint.h> -#include <../plugin/odeimps/odesliderjoint.h> +#include <oxygen/physicsserver/int/sliderjointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -29,7 +29,7 @@ SliderJoint::SliderJoint() : Generic6DOFJoint() { - mSliderJointImp = boost::shared_ptr<SliderJointImp>(new SliderJointImp()); + } SliderJoint::~SliderJoint() @@ -38,6 +38,10 @@ void SliderJoint::OnLink() { + if (mSliderJointImp.get() == 0) + mSliderJointImp = shared_dynamic_cast<SliderJointInt> + (GetCore()->New("SliderJointImp")); + long world = GetWorldID(); if (world == 0) { Modified: branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/softbody.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/softbody.h> -#include <../plugin/odeimps/odesoftbody.h> +#include <oxygen/physicsserver/int/softbodyint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<SoftBodyInt> SoftBody::mSoftBodyImp; SoftBody::SoftBody() : Body(){ - mSoftBodyImp = boost::shared_ptr<SoftBodyImp>(new SoftBodyImp()); + } SoftBody::~SoftBody(){ } + +void SoftBody::OnLink() +{ + if (mSoftBodyImp.get() == 0) + mSoftBodyImp = shared_dynamic_cast<SoftBodyInt> + (GetCore()->New("SoftBodyImp")); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/softbody.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ SoftBody(); virtual ~SoftBody(); + virtual void OnLink(); + static boost::shared_ptr<SoftBodyInt> mSoftBodyImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/space.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,7 +20,7 @@ */ #include <oxygen/physicsserver/space.h> -#include <../plugin/odeimps/odespace.h> +#include <oxygen/physicsserver/int/spaceint.h> #include <oxygen/physicsserver/collider.h> #include <oxygen/physicsserver/world.h> #include <oxygen/sceneserver/scene.h> @@ -35,7 +35,7 @@ Space::Space() : PhysicsObject(), mSpaceID(0) { - mSpaceImp = boost::shared_ptr<SpaceInt>(new SpaceImp()); + } Space::~Space() @@ -179,6 +179,10 @@ bool Space::ConstructInternal() { + if (mSpaceImp.get() == 0) + mSpaceImp = shared_dynamic_cast<SpaceInt> + (GetCore()->New("SpaceImp")); + mContactGroupID = mSpaceImp->CreateContactGroup(); return (mContactGroupID != 0); Modified: branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/spherecollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,17 @@ */ #include <oxygen/physicsserver/spherecollider.h> -#include <../plugin/odeimps/odespherecollider.h> +#include <oxygen/physicsserver/int/spherecolliderint.h> using namespace oxygen; using namespace salt; +using namespace boost; boost::shared_ptr<SphereColliderInt> SphereCollider::mSphereColliderImp; SphereCollider::SphereCollider() : ConvexCollider() { - mSphereColliderImp = boost::shared_ptr<SphereColliderImp>(new SphereColliderImp()); + } void SphereCollider::SetRadius(float r) @@ -43,7 +44,11 @@ } bool SphereCollider::ConstructInternal() -{ +{ + if (mSphereColliderImp.get() == 0) + mSphereColliderImp = shared_dynamic_cast<SphereColliderInt> + (GetCore()->New("SphereColliderImp")); + if (!Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,16 +20,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/staticbody.h> -#include <../plugin/odeimps/odestaticbody.h> +#include <oxygen/physicsserver/int/staticbodyint.h> using namespace oxygen; +using namespace boost; boost::shared_ptr<StaticBodyInt> StaticBody::mStaticBodyImp; StaticBody::StaticBody() : Body(){ - mStaticBodyImp = boost::shared_ptr<StaticBodyImp>(new StaticBodyImp()); + } StaticBody::~StaticBody(){ } + +void StaticBody::OnLink() +{ + if (mStaticBodyImp.get() == 0) + mStaticBodyImp = shared_dynamic_cast<StaticBodyInt> + (GetCore()->New("StaticBodyImp")); +} Modified: branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/staticbody.h 2010-02-23 09:13:36 UTC (rev 168) @@ -41,6 +41,8 @@ StaticBody(); virtual ~StaticBody(); + virtual void OnLink(); + static boost::shared_ptr<StaticBodyInt> mStaticBodyImp; }; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/transformcollider.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -20,21 +20,27 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <../plugin/odeimps/odetransformcollider.h> +#include <oxygen/physicsserver/int/transformcolliderint.h> #include <oxygen/physicsserver/transformcollider.h> +#include <iostream> using namespace oxygen; using namespace salt; +using namespace boost; boost::shared_ptr<TransformColliderInt> TransformCollider::mTransformColliderImp; TransformCollider::TransformCollider() : Collider() { - mTransformColliderImp = boost::shared_ptr<TransformColliderImp>(new TransformColliderImp()); + } bool TransformCollider::ConstructInternal() -{ +{ + if (mTransformColliderImp.get() == 0) + mTransformColliderImp = shared_dynamic_cast<TransformColliderInt> + (GetCore()->New("TransformColliderImp")); + if (! Collider::ConstructInternal()) { return false; Modified: branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/universaljoint.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -18,7 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <oxygen/physicsserver/universaljoint.h> -#include <../plugin/odeimps/odeuniversaljoint.h> +#include <oxygen/physicsserver/int/universaljointint.h> +#include <oxygen/physicsserver/int/jointint.h> #include <zeitgeist/logserver/logserver.h> using namespace oxygen; @@ -29,7 +30,7 @@ UniversalJoint::UniversalJoint() : Generic6DOFJoint() { - mUniversalJointImp = boost::shared_ptr<UniversalJointImp>(new UniversalJointImp()); + } UniversalJoint::~UniversalJoint() @@ -37,7 +38,13 @@ } void UniversalJoint::OnLink() -{ +{ + Joint::OnLink(); + + if (mUniversalJointImp.get() == 0) + mUniversalJointImp = shared_dynamic_cast<UniversalJointInt> + (GetCore()->New("UniversalJointImp")); + long world = GetWorldID(); if (world == 0) Modified: branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp =================================================================== --- branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2010-02-23 06:44:39 UTC (rev 167) +++ branches/multiphys/spark/lib/oxygen/physicsserver/world.cpp 2010-02-23 09:13:36 UTC (rev 168) @@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <../plugin/odeimps/odeworld.h> +#include <oxygen/physicsserver/int/worldint.h> #include <oxygen/physicsserver/space.h> #include <oxygen/physicsserver/world.h> #include <oxygen/sceneserver/scene.h> @@ -32,7 +32,7 @@ World::World() : PhysicsObject() { - mWorldImp = boost::shared_ptr<WorldInt>(new WorldImp()); + } World::~World() @@ -101,6 +101,10 @@ bool World::ConstructInternal() { + if (mWorldImp.get() == 0) + mWorldImp = shared_dynamic_cast<WorldInt> + (GetCore()->New("WorldImp")); + mWorldID = mWorldImp->CreateWorld(); return (mWorldID != 0); @@ -116,7 +120,7 @@ recurseLock = true; - shared_ptr<Space> space = GetSpace(); + shared_ptr<World> space = GetWorld(); if (space.get() != 0) { space->DestroyPhysicsObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |