Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / CDTestFramework / BulletSAPCompleteBoxPruningTest.h
1 /*
2 BulletSAPCompleteBoxPruningTest, Copyright (c) 2008 Erwin Coumans
3 Part of:
4 CDTestFramework http://codercorner.com
5 Copyright (c) 2007-2008 Pierre Terdiman,  pierre@codercorner.com
6
7 This software is provided 'as-is', without any express or implied warranty.
8 In no event will the authors be held liable for any damages arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose, 
10 including commercial applications, and to alter it and redistribute it freely, 
11 subject to the following restrictions:
12
13 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.
14 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
15 3. This notice may not be removed or altered from any source distribution.
16 */
17
18 #ifndef BULLET_SAP_COMPLETEBOXPRUNING_H
19 #define BULLET_SAP_COMPLETEBOXPRUNING_H
20
21 #include "LinearMath/btAlignedObjectArray.h"
22
23 #include "CollisionTest.h"
24 #include "Profiling.h"
25
26         class BulletSAPCompleteBoxPruningTest : public CollisionTest
27         {
28                 public:
29                                                                 BulletSAPCompleteBoxPruningTest(int numBoxes,int method);
30                 virtual                                 ~BulletSAPCompleteBoxPruningTest();
31
32                 virtual void                    Init();
33                 virtual void                    Release();
34                 virtual void                    PerformTest();
35                 void                                    RenderAll();
36                 void                                    Render();
37                 virtual void                    Select();
38                 virtual void                    Deselect();
39                 virtual void                    KeyboardCallback(unsigned char key, int x, int y);
40                 virtual void                    MouseCallback(int button, int state, int x, int y);
41                 virtual void                    MotionCallback(int x, int y);
42
43                                 TwBar*                  mBar;           //!< AntTweakBar
44                                 Profiler                mProfiler;
45
46                                 class btBroadphaseInterface*    m_broadphase;
47                                 bool                                                    m_isdbvt;
48                                 btAlignedObjectArray<struct  btBroadphaseProxy*> m_proxies;
49
50                                 udword                  mNbBoxes;
51                                 AABB*                   mBoxes;
52                                 bool*                   mFlags;
53                                 const char*             methodname;
54                                 const AABB**    mBoxPtrs;
55                                 Pairs                   mPairs;
56                                 float*                  mBoxTime;
57                                 float                   mAmplitude;
58                                 bool                    m_firstTime;
59                                 int                             m_method;
60
61                 private:
62                                 bool                    UpdateBoxes(int numBoxes);
63         };
64
65 #endif  // BULLET_SAP_COMPLETEBOXPRUNING_H