btCollisionAlgorithm.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_COLLISION_ALGORITHM_H
00017 #define BT_COLLISION_ALGORITHM_H
00018 
00019 #include "LinearMath/btScalar.h"
00020 #include "LinearMath/btAlignedObjectArray.h"
00021 
00022 struct btBroadphaseProxy;
00023 class btDispatcher;
00024 class btManifoldResult;
00025 class btCollisionObject;
00026 struct btCollisionObjectWrapper;
00027 struct btDispatcherInfo;
00028 class   btPersistentManifold;
00029 
00030 typedef btAlignedObjectArray<btPersistentManifold*>     btManifoldArray;
00031 
00032 struct btCollisionAlgorithmConstructionInfo
00033 {
00034         btCollisionAlgorithmConstructionInfo()
00035                 :m_dispatcher1(0),
00036                 m_manifold(0)
00037         {
00038         }
00039         btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)
00040                 :m_dispatcher1(dispatcher)
00041         {
00042                 (void)temp;
00043         }
00044 
00045         btDispatcher*   m_dispatcher1;
00046         btPersistentManifold*   m_manifold;
00047 
00048 //      int     getDispatcherId();
00049 
00050 };
00051 
00052 
00055 class btCollisionAlgorithm
00056 {
00057 
00058 protected:
00059 
00060         btDispatcher*   m_dispatcher;
00061 
00062 protected:
00063 //      int     getDispatcherId();
00064         
00065 public:
00066 
00067         btCollisionAlgorithm() {};
00068 
00069         btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);
00070 
00071         virtual ~btCollisionAlgorithm() {};
00072 
00073         virtual void processCollision (const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
00074 
00075         virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
00076 
00077         virtual void    getAllContactManifolds(btManifoldArray& manifoldArray) = 0;
00078 };
00079 
00080 
00081 #endif //BT_COLLISION_ALGORITHM_H