btDispatcher.h
Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 
00016 #ifndef BT_DISPATCHER_H
00017 #define BT_DISPATCHER_H
00018 #include "LinearMath/btScalar.h"
00019 
00020 class btCollisionAlgorithm;
00021 struct btBroadphaseProxy;
00022 class btRigidBody;
00023 class   btCollisionObject;
00024 class btOverlappingPairCache;
00025 
00026 
00027 class btPersistentManifold;
00028 class btStackAlloc;
00029 class btPoolAllocator;
00030 
00031 struct btDispatcherInfo
00032 {
00033         enum DispatchFunc
00034         {
00035                 DISPATCH_DISCRETE = 1,
00036                 DISPATCH_CONTINUOUS
00037         };
00038         btDispatcherInfo()
00039                 :m_timeStep(btScalar(0.)),
00040                 m_stepCount(0),
00041                 m_dispatchFunc(DISPATCH_DISCRETE),
00042                 m_timeOfImpact(btScalar(1.)),
00043                 m_useContinuous(true),
00044                 m_debugDraw(0),
00045                 m_enableSatConvex(false),
00046                 m_enableSPU(true),
00047                 m_useEpa(true),
00048                 m_allowedCcdPenetration(btScalar(0.04)),
00049                 m_useConvexConservativeDistanceUtil(false),
00050                 m_convexConservativeDistanceThreshold(0.0f),
00051                 m_stackAllocator(0)
00052         {
00053 
00054         }
00055         btScalar        m_timeStep;
00056         int                     m_stepCount;
00057         int                     m_dispatchFunc;
00058         mutable btScalar        m_timeOfImpact;
00059         bool            m_useContinuous;
00060         class btIDebugDraw*     m_debugDraw;
00061         bool            m_enableSatConvex;
00062         bool            m_enableSPU;
00063         bool            m_useEpa;
00064         btScalar        m_allowedCcdPenetration;
00065         bool            m_useConvexConservativeDistanceUtil;
00066         btScalar        m_convexConservativeDistanceThreshold;
00067         btStackAlloc*   m_stackAllocator;
00068 };
00069 
00072 class btDispatcher
00073 {
00074 
00075 
00076 public:
00077         virtual ~btDispatcher() ;
00078 
00079         virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;
00080 
00081         virtual btPersistentManifold*   getNewManifold(void* body0,void* body1)=0;
00082 
00083         virtual void releaseManifold(btPersistentManifold* manifold)=0;
00084 
00085         virtual void clearManifold(btPersistentManifold* manifold)=0;
00086 
00087         virtual bool    needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;
00088 
00089         virtual bool    needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;
00090 
00091         virtual void    dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;
00092 
00093         virtual int getNumManifolds() const = 0;
00094 
00095         virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;
00096 
00097         virtual btPersistentManifold**  getInternalManifoldPointer() = 0;
00098 
00099         virtual btPoolAllocator*        getInternalManifoldPool() = 0;
00100 
00101         virtual const btPoolAllocator*  getInternalManifoldPool() const = 0;
00102 
00103         virtual void* allocateCollisionAlgorithm(int size)  = 0;
00104 
00105         virtual void freeCollisionAlgorithm(void* ptr) = 0;
00106 
00107 };
00108 
00109 
00110 #endif //BT_DISPATCHER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


bullet
Author(s): Erwin Coumans, ROS package maintained by Tully Foote
autogenerated on Wed Oct 31 2012 07:54:31