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] |