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