Fixed several bugs: python refcounting related and Bullet related (basic add/remove...
[blender.git] / extern / bullet / BulletDynamics / CollisionDispatch / ConvexConvexAlgorithm.h
1 /*
2  * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
3  *
4  * Permission to use, copy, modify, distribute and sell this software
5  * and its documentation for any purpose is hereby granted without fee,
6  * provided that the above copyright notice appear in all copies.
7  * Erwin Coumans makes no representations about the suitability 
8  * of this software for any purpose.  
9  * It is provided "as is" without express or implied warranty.
10 */
11 #ifndef CONVEX_CONVEX_ALGORITHM_H
12 #define CONVEX_CONVEX_ALGORITHM_H
13
14 #include "BroadphaseCollision/CollisionAlgorithm.h"
15 #include "NarrowPhaseCollision/GjkPairDetector.h"
16 #include "NarrowPhaseCollision/PersistentManifold.h"
17 #include "BroadphaseCollision/BroadphaseProxy.h"
18 #include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
19
20 class ConvexPenetrationDepthSolver;
21
22 ///ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations.
23 class ConvexConvexAlgorithm : public CollisionAlgorithm
24 {
25         ConvexPenetrationDepthSolver*   m_penetrationDepthSolver;
26         VoronoiSimplexSolver    m_simplexSolver;
27         GjkPairDetector m_gjkPairDetector;
28         bool    m_useEpa;
29 public:
30         BroadphaseProxy m_box0;
31         BroadphaseProxy m_box1;
32
33         bool    m_ownManifold;
34         PersistentManifold*     m_manifoldPtr;
35         bool                    m_lowLevelOfDetail;
36
37         void    CheckPenetrationDepthSolver();
38
39         
40
41 public:
42
43         ConvexConvexAlgorithm(PersistentManifold* mf,const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
44
45         virtual ~ConvexConvexAlgorithm();
46
47         virtual void ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,float timeStep,int stepCount, bool useContinuous);
48
49         virtual float CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,float timeStep,int stepCount);
50
51         void    SetLowLevelOfDetail(bool useLowLevel);
52
53         float   GetCollisionImpulse() const;
54
55         const PersistentManifold*       GetManifold()
56         {
57                 return m_manifoldPtr;
58         }
59
60 };
61
62 #endif //CONVEX_CONVEX_ALGORITHM_H