source: trunk/test/BtPhysTest.h @ 1591

Last change on this file since 1591 was 1591, checked in by touky, 9 years ago

Behold the power of LolPhysics !
Added lol::phys::Simulation, lol::phys::EasyPhysics for easy physic uses.
Added PhysicsObject, wich hold EasyMesh & EasyPhysics components so it is easy to use. Easy seems to be the consensus.
BtPhysTest now works with new physics classes.

Known problem for this commit:
Physics is not properly setup.
There might be memory leaks, I don't think I've parsed all new/delete.
A LOT of primitives are not taken into account.

File size: 1.2 KB
Line 
1//
2// BtPhysTest
3//
4// Copyright: (c) 2009-2012 Benjamin Huet <huet.benjamin@gmail.com>
5//            (c) 2012 Sam Hocevar <sam@hocevar.net>
6//
7
8#if !defined __BTPHYSTEST_H__
9#define __BTPHYSTEST_H__
10
11class BtPhysTest : public WorldEntity
12{
13public:
14    BtPhysTest(bool editor = false);
15    virtual ~BtPhysTest();
16
17    char const *GetName() { return "<BtPhysTest>"; }
18
19protected:
20    virtual void TickGame(float seconds);
21    virtual void TickDraw(float seconds);
22
23private:
24    Camera*                                                             m_camera;
25    bool                                                                m_ready;
26
27        lol::phys::Simulation*                          m_simulation;
28        Array<PhysicsObject*>                           m_physobj_list;
29        PhysicsObject*                                          m_ground_object;
30
31#if 0
32        EasyMesh                                                        m_ground_mesh;
33        EasyMesh                                                        m_rigid_mesh[6];
34
35        //Bullet Physics Datas
36        enum
37        {
38                USE_CCD=1,
39                USE_NO_CCD
40        };
41        int                                                                     m_bt_ccd_mode;
42        btDefaultCollisionConfiguration*                m_bt_collision_config;
43        btCollisionDispatcher*                                  m_bt_dispatcher;
44        btDbvtBroadphase*                                               m_bt_broadphase;
45        btSequentialImpulseConstraintSolver*    m_bt_solver;
46        btDiscreteDynamicsWorld*                                m_bt_world;
47        Array<btCollisionShape*>                                m_bt_collision_shapes;
48        Array<btCollisionShape*>                                m_bt_dynamic_shapes;
49#endif
50};
51
52#endif // __BTPHYSTEST_H__
53
Note: See TracBrowser for help on using the repository browser.