Back to index

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